Return value based on given criteria
The Excel IF function is a handy logical operator that return value based on a valid test of criteria, if it matches (TRUE) and another value if it does not.
= IF(logical_test, value_if_true, [value_if_false])
logical_test – The criteria to evaluate.
value_if_true [optional] – The value to return if criteria match (TRUE).
value_if_false – [optional] – The value to return if criteria does not match (FALSE).
Value based on the optional argument
The IF function can test an argument (logical_test) and return the corresponding value of TRUE or FALSE logic, unlike IFS function that can evaluate multiple logics at once but limited to one FALSE argument.
For Example, if a teacher wants to check that students are pass or fail when the minimum passing mark is 50.
IF function may be used to verify such logic,
So, the logical test is ‘B5>50’ if the cell value of B5 is higher than 50 (TRUE) then function return Pass otherwise Fail.
IF function allows returning a blank result that can easily get substituted with another formula.
Returns #N/A error if none of the logic tests is TRUE.