IF Statement in Microsoft Excel

In the post, let’s learn about the conditional statements in Excel and how you can use IF Statement in the formulas in Excel worksheets.

What is IF Statement in Excel and its uses?

The IF statement is a decision-making statement that guides a program to make decisions based on specified criteria. It executes one set of code if a specified condition is met (TRUE) or another set of code evaluates to FALSE.

The following are the steps to use IF Statement in excel:

  • First, prepare an excel sheet with the required details in it.
IF Statement in Microsoft Excel
  • To check the condition, you can use the IF Function formula:
  • =IF(logical_test,[value_if_true],[value_if_false])
IF Statement in Microsoft Excel

Nested If Statement

  • A “Nested IF” refers to a formula where at least one IF function is nested inside another to test for more conditions and return more possible results.
  • You can use the following formula: =IF(B2>95,”A”,IF(B2>90,”B”,IF(B2>85,”C”,IF(B2>80,”D”)))) or =IF(B5>95,”A”,IF(B5>90,”B”,IF(B5>85,”C”,”D”))).
If Statement in Excel

IF Statement with AND & OR

  • The AND Function returns a TRUE value if all conditions are true and returns a FALSE value if any of the conditions are false. The AND (&&) operations of two inputs A and B can be written as “AB”.
  • To use the IF Function in combination with the And function, you can follow the given formula: =IF(AND(B2>=60,C2>=90),”Pass”,”Fail”).
If Statement in Excel
  • The OR function returns TRUE if any of the conditions are TRUE and returns FALSE if all conditions are false. The OR (||) value of two inputs A and B can also be written as “A+B”.
  • To use the IF Function in combination with the OR function, you can follow the given formula: =IF(OR(B2>=60,C2>=60),”Pass”,”Fail”)
IF Statement in Microsoft Excel

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn how to Find Blank cells in excel so that you can remove or delete the blank cells form...
In this article, you’ll learn what is a Gauge Chart in Microsoft Excel. Also, you will learn how to add...
Microsoft Excel provides a shortcut for the users to move columns in excel using two different ways – using Shift...