ExcelCSE.com

Menu
  • Excel 101
  • Excel Functions
  • Excel Formula
  • Contact Us
How to Use Excel > Excel Functions > Excel IF Statement

Excel IF Statement

How to Write Excel IF Statement
Table of contents :
  • What is the Excel IF Function?
  • IF Syntax
  • How to Use IF Function in Excel
    • Excel IF Then Statements Examples (One Criteria)
    • Excel IF AND Statements Examples (Two Criteria, ALL Must be TRUE)
    • Excel IF OR Statements Examples (Two Criteria, One Must be TRUE)
  • Multiple IF Statements in Excel

How to Use IF Function in Excel

What is the Excel IF Function?


The IF function is a logical function to analyze a condition. If the condition met the criteria (TRUE) return value_if_true argument, otherwise (FALSE) return value_if_false argument.

IF Syntax

IF(logical_test, [value_if_true], [value_if_false])

logical_test (required), the condition you want to analyze, are in accordance with the criteria. The result is a TRUE / FALSE value.

value_if_true (required), returned value if logical test is TRUE

value_if_false (optional), returned value if logical test is FALSE. value_if_false argument is optional, if omitted then return FALSE.

How to Use IF Function in Excel

IF Then Statements Examples (One Criteria)

For example, there are data such as the image below.

Excel IF Statement Example

Who has an overweight body? According to the BMI, overweight body has a BMI value greater than or equal to 25.

To find out anyone who has overweight body, no need to use IF function. Simply use the >= operator, you can find out who has overweight body, but the result is not informative, showing only TRUE/FALSE value, for the more informative result you can use Excel IF Statement

How to Use IF Function

There are only 1 criteria, i.e. BMI>=25, showing “Overweight” text. If there are BMI value less than 25, IF function return nothing. Here are the steps how to use the IF function in excel.

  • Place the cursor in cell E2
  • Type the formula for IF function
  • logical_test argument, type criteria #1 D2>=25
  • value_if_true argument, type “Overweight”
  • value_if_false argument, type nothing/blank space “”

If the formula is typed correctly, it will look like below

=IF(D2>=25,"Overweight","")

Do a copy in E2 then do a paste in range E3:E9. The results are as shown below.

More informative result, not just TRUE/FALSE values.

Excel IF AND Statements Examples (Two Criteria, ALL Must be TRUE)

With the same data as the previous example. The question is who has the ideal body weight?

The Ideal body weight has BMI value greater than or equal 18.5 AND less than or equal 24.9. Look like there are many criteria, but essentially there are only 2 criteria, i.e. ideal and no ideal body weight. The ideal body weight is determined by 2 criteria (BMI>=18.5 and BMI<=24.9) both must be TRUE. Use the AND function to evaluate both criteria.

Here are the steps using the IF function with the AND function in the logical_test argument.

  • Place the cursor in cell E2
  • Type the formula for the IF function
  • The logical_test argument, fill with AND function and both criteria, AND(D2>=18.5,D2<=24.9)
  • The value_if_true argument, Type “Ideal”
  • The value_if_false argument, Type nothing/blank space “”

If the formula is typed correctly, it will look like below

=IF(AND(D2>=18.5,D2<=24.9),"Ideal","")

Do a copy in E2 then do a paste in range E3:E9. The results are as shown below.

Compare with the AND function results in the “How to Use AND Function” article. Which one is more informative, and which one is your choice? 🙂

Excel IF OR Statements Examples (Two Criteria, One Must be TRUE)


With the same data as the previous example. The question is who has no ideal body weight?

The No Ideal body weight has BMI value less than 18.5 OR greater than 24.9. There are 2 criteria, i.e. ideal and no ideal body weight, same as the previous example but with different questions. The no ideal body weight is determined by 2 criteria (BMI<18.5 or BMI>24.9) one of them must be TRUE. Use the OR function to evaluate both criteria.

Here are the steps using the IF function with the OR function in the logical_test argument.

  • Place the cursor in cell E2
  • Type the formula for the IF function
  • The logical_test argument, fill with OR function and both criteria, OR(D2<18.5,D2>24.9)
  • The value_if_true argument, Type “No Ideal”
  • The value_if_false argument, Type nothing/blank space “”

If the formula is typed correctly, it will look like below

=IF(OR(D2<18.5,D2>24.9),"No Ideal","")

Do a copy in E2 then do a paste in range E3:E9. The results are as shown below.

Compare with the OR function results in the “How to Use OR Function” article. Which one is more informative, OR function result or IF function result 🙂

Multiple IF Statements in Excel


With the same data as the previous example, does the IF function able to determine the weight categories of each name according to BMI value?

How to Do IF Function in Excel

Of course, IF function able to do it. There are 6 criteria, because the IF function is only able to analyze 2 criteria, then it takes more than 1 IF function know as Multiple IF Statements or Nested IF Statements.

The number of required IF function is the number of criteria minus 1. There are 6 criteria, so it takes 5 IF function to determine the weight category for each name.

IF Statement Example

For more details explanation, please read the following article:

  • How to Do Multiple IF Statements in Excel
Another article using or explain about IF Function
  • Calculate Number of Days, Weeks, Months and Years Between Two Dates in Excel
  • Excel Divide by Zero Error
  • How to Determine If a Number is Even or Odd
  • Multiple IF Statements in Excel
  • Excel IF Statement

Another Logical Function

Another article about Logical Function
  • Excel IFNA Function
  • Excel AVERAGEIFS Function
  • Excel AVERAGEIF Function
  • Excel IFERROR Function
  • Excel SUMIFS Function
  • Excel SUMIF Function
  • Excel IFS Function
  • Excel IF Statement
  • Excel AND Function
  • Excel OR Function
Usefull links
  • Microsoft IF Function Documentation
Share
Tweet
Google+
Email
Prev Article
Next Article

Related Articles

Excel SUBTOTAL Function
What is the Excel SUBTOTAL Function? The Excel SUBTOTAL function …

Excel SUBTOTAL Function

Excel FIND Function
What is the Excel FIND Function? The excel FIND function …

Excel FIND Function

Excel Weekday Function
What is the Excel WEEKDAY Function? Excel WEEKDAY function returns …

Excel WEEKDAY Function

Excel MID Function
What is the Excel MID Function? The excel MID function …

Excel MID Function

How to Use SUMIFS in Excel
What is the Excel SUMIFS Function? The SUMIFS function is …

Excel SUMIFS Function

Tags:Excel IF Example Excel IF Formula Examples Excel IF Function Examples Excel IF Function Text Excel IF Statement Example How to Do IF Function in Excel How to Use IF Function How to Use IF Function in Excel How to Use The IF Function in Excel 2016 IF Function IF Function Examples IF Function Excel If Function in Ms Excel IF Function With Text IF Statement Example If Then Statements Examples Logical Function Microsoft Excel IF Function The IF Function What is IF Function

Categories

  • Excel 101
  • Excel Formula
  • Excel Functions

Recent Posts

  • Get the Original Price from Percentage Increase/Decrease
  • How to Add/Subtract Percentage in Excel
  • How to Extract Day, Month and Year from Date in Excel
  • How to Add Seconds, Minutes and Hours to a Time in Excel
  • How to Add Days, Weeks, Months and Years to a Date in Excel
  • How to Calculate Time Difference in Excel
  • Calculate Number of Days, Weeks, Months and Years Between Two Dates in Excel
  • Flash Fill Excel
  • Paste Special Excel
  • Excel TEXTJOIN Function
  • Excel CONCAT Function
  • Excel CONCATENATE Function
  • Excel REPLACE Function
  • Excel SUBSTITUTE Function
  • Excel REPT Function
  • Excel FIND Function
  • Excel SEARCH Function
  • Excel MID Function
  • Excel RIGHT Function
  • Excel LEFT Function

ExcelCSE.com

The Ultimate Guide How to Use Excel Better
Copyright © 2019 ExcelCSE.com
Contact Us - Privacy Policy - Sitemap | Theme by MyThemeShop.com

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh