Home

How to Evaluate a Condition with the IF Function in Excel 2016

|
|  Updated:  
2016-03-26 7:15:21
Windows 365 For Dummies
Explore Book
Buy On Amazon

The IF function determines whether or not a condition is true, and then perform different actions in Excel 2016 based on that answer. IF is only one of many logical functions that Excel provides; see the list on the Logical button on the Formulas tab for others. For example:

  • Suppose a customer gets a 10 percent discount if he spends more than $50. You could use the IF function to determine whether his order amount qualifies.

    The amount of discount is determined using an IF function.
    The amount of discount is determined using an IF function.

    An IF function typically contains three arguments: condition, value_if_true, and value_if_false. Like all arguments, they are separated by commas.

  • The condition in this example is D5>=50. In other words, is the value in D5 greater than or equal to 50?

  • The value_if_true in this example is calculated by multiplying D5 by 0.1 (in other words, calculating 10 percent of it).

  • The value_if_false in this example is zero (0).

    An <span class=IF function with three arguments." width="535"/>
    An IF function with three arguments.

The condition argument is the only required one. If you omit the value_if_true argument, the function returns 1 if the condition is true and 0 if the condition is false. If you omit the value_if_false argument, a value of 0 is assumed for it. Therefore in the above example, technically you wouldn’t have to include the value_if_false argument, since zero was the desired result anyway.

If you want to combine a SUM operation with an IF condition, you can use the SUMIF function, which does both at once. It sums a range of data if the condition you specify in its argument is true. You’ll find it on the Math & Trig button’s list, rather than under the Logical category.

About This Article

This article is from the book: 

About the book author:

Faithe Wempen, M.A., is a Microsoft Office Master Instructor and the author of over 150 books on computer technology, including Outlook 2019 for Dummies and PowerPoint Bible. She is also a CompTIA A+ certified PC technician and an adjunct Computer Technology instructor at Purdue University. Her online courses in Office applications and digital literacy have educated over a quarter of a million students for corporate clients.