Returns one of two given values, depending on a test condition.
Syntax
IF(test; value1; value2)
test: Logical value or expression. Eg., B2>50
value1: The value that is returned by the function if test yields true. Eg., "Pass"
value2: The value that is returned by the function if test yields false. Eg., "Fail"
Examples
Formula | Result |
IF(A1>3;"True";"False") | True |
IF(D4=2.1;"Yes";"No") | No |
=IF(B2>50;"Pass";"Fail") | Pass |
Get a hands-on experience of the function in the embedded range below.
Possible Errors
Errors | Meaning |
#N/A! | |
#NAME! | The function name is incorrect or invalid. The given defined name (if any) is invalid. There is a typo in the defined name used in the function. Double quotes are missing for text values in the function. Colon missing in a cell range reference.
|
#VALUE! | |
#REF! | |
Similar Functions