IF

Description

IF tests the condition and returns the specified value.

Syntax

IF ( condition, true_value, false_value )

 

Parameter

Description

condition

Any logical expression.

True_value

The value to be returned if condition evaluates to True.

False_value

The value to be returned if condition evaluates to False.

Example

This function returns Greater if the contents of A1 is greater than 10, Less if the contents of A1 is less than 10, or Equal if the contents of A1 equals 10:

IF(A1>10, "Greater", "Less")

 Note:

If an Invalid formula syntax warning appears, check whether the comma is set as the list separator in your regional settings on the Windows Control Panel. If a different character is set as the list separator, use this character in the above examples in place of the comma. (Windows XP: Access the Windows Control Panel and select Regional and Language Options. On the Regional Options tab page, click Customize. On the Numbers tab page, check which character is the default list separator on your computer. Use this character in the above examples instead of the comma.

Also, see

AND

FALSE

NOT

OR

TRUE