The IF Function
One of the logical Excel functions is a built-in IF function. It can be used as a worksheet function (WS) in Excel. The IF function can be entered as part of a formula in a cell of a worksheet. It is possible to nest multiple IF functions within one Excel formula. You can nest up to seven IF functions to create a complex IF THEN ELSE statement. The IF function evaluates a certain user specified condition and returns a user-specified value based on this condition. If the condition is TRUE one value is shown or formula is used and if the condition is FALSE then another value or formula is used and result is shown in the user-specified cell.
The syntax for Excel IF is as follows:
=IF(logical_test, [value_if_true], ...