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.
- All Excel versions
|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|
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.
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.
You will get 0 as a result when either value_if_true or value_if_False argument is empty.