How to use IF Formula in Excel?

The IF formula in Excel makes logical comparison between a value and your expectation. The IF formula in Excel is a part of logical formulas.

The article in this webpage describes how to use IF formula in Microsoft Excel with syntax, detailed explanation and examples.

Subscribe our YouTube channel to know the latest updates, tips and tricks.

What is IF Formula in Excel?

The IF formula in Excel checks a specified condition and returns value based on TRUE or FALSE results. It returns one value if TRUE and another value if FALSE. In the IF formula you will get any one out of two results. You will get the first result if the condition is TRUE and the second if the condition is FALSE.

The IF formula is one of the most popular formulas in Microsoft Excel. You can combine the IF formula with other formulas (such as AND, OR, and NOT etc) for better logical comparison. The new IFS formula is the alternative of nested IF formula, which is available in the latest Excel version.

What is the Syntax of IF Formula in Excel?

The syntax of IF formula is:

=IF(logical_test, value_if_true, [value_if_false])

What are the Arguments of IF Formula in Excel?

The arguments for IF formula are explained below in detail and summary for your easy reference:

Logical Test (Required Argument)

This is the condition you want to test.

Value if True (Required Argument)

This is the value you want to return if the result of the condition is True.

Value if False (Optional Argument)

This is the value you want to return if the result of the condition is False.

IF Arguments:

  • Logical Test (Required) – condition.
  • Value if True (Required) – value if condition is True.
  • Value if False (Optional) – value if condition is False.

How to use Excel IF Formula with Examples?

Example 1 (simple IF formula)

In this simple IF formula example, if marks in cell C6 is greater than or equal to 80 then pass otherwise fail.

=IF(C6>=80,”Pass”,”Fail”)

How to use IF Formula in Excel with Example (simple IF formula)

IF formula Example (simple IF formula)

Example 2 (nested IF formula)

In the below nested IF formula example, the IF formula is used multiple times to meet multiple conditions.

=IF(C6>=90,”A”,IF(C6>=80,”B”,IF(C6>=60,”C”,”D”)))

How to use IF Formula in Excel with Example (nested IF formula)

IF formula Example (nested IF formula)

Example 3 (IF + AND formula)

You can combine the IF formula with AND formula, to meet multiple conditions before getting the value based on TRUE or FALSE results. In the below example, if marks in both cell C6 and D6 are greater than or equal to 80 then pass otherwise fail.

=IF(AND(C6>=80,D6>=80),”Pass”,”Fail”)

How to use IF Formula in Excel with Example (IF + AND formula)

IF formula Example (IF + AND formula)

Example 4 (IF + OR formula)

In IF + OR formula, if any one of the conditions is met then you will get the value based on TRUE or FALSE results. In the below example, if marks in either cell C6 or D6 is greater than or equal to 80 then pass otherwise fail.

=IF(OR(C6>=80,D6>=80),”Pass”,”Fail”)

How to use IF Formula in Excel with Example (IF + OR formula)

IF formula Example (IF + OR formula)

Example 5 (IF + NOT formula)

In IF + NOT formula, if it is not fulfilling the condition then you will get the value based on TRUE or FALSE results. In the below example, if marks in cell C6 is not less than 80 then pass otherwise fail.

=IF(NOT(C6<80),”Pass”,”Fail”)

How to use IF Formula in Excel with Example (IF + NOT formula)

IF formula Example (IF + NOT formula)

Example 6 (Number Calculation)

If the value to return is a number or any calculated number, then you do not need to add double quote before or after that number. The double quote is required only for text output and not for numbers. In the below IF formula example, the value if true and false results are numbers.

=IF(C6>=80,(C6+D6/100),0)

How to use IF Formula in Excel with Example (Number Calculation)

IF formula Example (Number Calculation)

What are the Key Points for IF Formula in Excel?

You must remeber the below key points while using the Excel IF formula:

  • You will get 0/FALSE result if there is no argument for either “value if true” or “value if False”. You should have two arguments to get the correct result.
  • The IF formula returns as #VALUE! error when the given condition cannot be met as TRUE or FALSE.
  • The most popular logical operators in the IF formula are:
    • = (equal to)
    • > (greater than)
    • >= (greater than or equal to)
    • < (less than)
    • <= (less than or equal to)
    • <> (not equal to)
How to use IF Formula in Excel

How to use IF Formula in Excel?

» Excel Home

» Excel Formulas

» Financial Formulas

» Logical Formulas

» Text Formulas

» Date & Time Formulas

» Lookup & Ref Formulas

» Math & Trig Formulas

» Statistical Formulas

» Engineering Formulas

» Cube Formulas

» Information Formulas

» Compatibility Formulas

» Web Formulas