IF(logical_test [,value_if_true] [,value_if_false])

Returns the value based on a condition you specify.

logical_testThe value or expression that can be evaluated to True or False.
value_if_trueThe value that is returned if "logical_test" is True.
value_if_falseThe value that is returned if "logical_test" is False.

Remarks

* For an illustrated example refer to the page under Advanced Functions.
* This function is not case sensitive.
* You can nest up to 64 IF functions.
* If "logical_test" is true and "value_if_true" is blank, then zero is returned.
* If "logical_test" is false and "value_if_false" is blank, then False is returned.
* If you use text arguments, this function is not case sensitive.
* This function can return an array formula.
* You can use the AND function to return the logical AND for any number of arguments.
* You can use the OR function to return the logical OR for any number of arguments.
* You can use the NOT function to return the opposite of a True or False value.
* You can use the IFS function to return a value based on multiple conditions.
* For the Microsoft documentation refer to support.office.com

 AB
1=IF(50<100,"true value","false value") = true value9
2=IF(100<50,"true value","false value") = false value14
3=IF(B2>20,"true value","false value") = false value41
4=IF(B2<30,"true value","false value") = true valueone
5=IF("text"="text",TRUE,FALSE) = Truetwo
6=IF("TEXT"="text",TRUE,FALSE) = True 
7=IF(ISBLANK(B6),"blank","not blank") = blank 
8=IF(B6="","blank","not blank") = blank 
9=IF(B2<10,10,IF(B2<=20,20,IF(B2<=30,30,IF(B2<=40,40,"over 40")))) = 20 
10=IF(B3<10,10,IF(B3<=20,20,IF(B3<=30,30,IF(B3<=40,40,"over 40")))) = over 40 
11=IF(AND(B4="one",B5="two"),"both","") = both 
12=IF(OR(B4="one",B1>30),"one","") = one 
13=IF(TRUE,"true value") = true value 
14=IF(FALSE,,"false value") = false value 
15=IF(TRUE,) = 0 
16=IF(TRUE,,"false value") = 0 
17=IF(FALSE,,"false value") = false value 
18=IF(FALSE,) = False 

1 - What value is returned when the logical test returns True.
2 - What value is returned when the logical test returns False.
3 - What value is returned when the logical test "B2>20" is evaluated.
4 - What value is returned when the logical test "B2<30" is evaluated.
5 - What value is returned when the condition "text"="text" is evaluated.
6 - What value is returned when the condition "TEXT"="text" is evaluated. This function is not case sensitive.
7 - What value is returned when the cell "B6" is passed to the function ISBLANK.
8 - What value is returned when the cell "B6" is compared to an empty string.
9 - What value is returned when the cell "B2" is evaluated using multiple nested IF functions.
10 - What value is returned when the cell "B3" is evaluated using multiple nested IF functions.
11 - What value is returned when the AND function is evaluated.
12 - What value is returned when the OR function is evaluated.
13 - What value is returned when the logical test is True and the "value_if_false" is not provided.
14 - What value is returned when the logical test is False and the "value_if_true" is blank.
15 - What value is returned when the logical test is True, the "value_if_true" is blank and the "value_if_false" is not provided.
16 - What value is returned when the logical test is True and the "value_if_true" is blank.
17 - What value is returned when the logical test is False and and the "value_if_true" is blank.
18 - What value is returned when the logical test is False, the "value_if_true" is blank and the "value_if_false" is not provided.

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top