Share on twitter
Share on linkedin
Share on facebook
Share on pinterest
Share on email
Share on print
Share on twitter
Share on linkedin
Share on facebook
Share on pinterest
Share on email
Share on print

IF

Return value based on given criteria in Excel
Specifies a logical test to perform

Rational

Return value based on given criteria

Description

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.

Syntax

= IF(logical_test, value_if_true, [value_if_false])

Parameters

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).

Return Value

Value based on the optional argument

Key Notes

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,

=IF(B5>50, “Pass”,”Fail”)

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.

Keep Reading Similar Functions:

Substitute #N/A error and replace with an alternate value in Excel

IFNA

The IFNA function evaluate given criterion (value) in case the return value is a #N/A error then it substitutes with a different text string (value_if_na).

Read More »
Substitute the error result and replace with an alternate value in Excel

IFERROR

The IFERROR function evaluates a criterion in case of an error then it substitutes with a different text string. I.e.,=IFERROR(2/0,”Error”) return “Error”.

Read More »
Check if one of the multiple criteria match in Excel

SWITCH

The SWITCH function lookup a value in a list of multiple data points and return the corresponding first match otherwise default value or #N/A return.

Read More »