The IF function performs a logical test (specified from its first argument), and returns either one of its second or third argument depending on the result of the test. If the test returns TRUE, the result will be the second argument, otherwise it will be the third. In this guide, we’re going to show you how to use the IF function along with some tips and error handling methods.
Supported versions
- All Excel versions
SUMIFS Syntax
Arguments
logical_test |
The logical statement you want to test |
value_if_true |
Return value if the result of logical_test is TRUE |
[value_if_false] |
Optional. Return value if the result of logical_test is FALSE |
Examples
Example 1
Example 2
Our formula checks the B3 cell. The first check is to determine whether the value of the cell is less than or equal to 151. If it is, the formula returns “I” string. If it not, it continues with the second IF function. The second function checks if the value is less than or equal to 251. Although a number less than 151 is also less than 251, the formula eliminates numbers less than 151 in the first step. The order of conditions is important.
Tips
- Operators
Operator
Description
Criteria Sample
Criteria Meaning
=
Equal to
“=10000”
Equal to 10000
<>
Not equal to
“<>10000”
Not equal to 10000
>
Greater than
“>10000”
Greater than 10000
<
Less than
“>10000”
Less than 10000
>=
Greater than or equal to
“>=10000”
Greater than or equal to 10000
<=
Less than or equal to
“<=10000”
Less than or equal to 10000
- A Nested-IF structure can include up to 64 IF statements.
Issues
0
You will get 0 as a result when either value_if_true or value_if_False argument is empty.