Written by Allen Wyatt (last updated July 17, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
Excel provides a wide range of worksheet functions you can use. One of the most versatile worksheet functions is IF. This function allows you to test some condition, and then use a value if the condition is true or a different value if the condition is false. For instance, consider the following example:
=IF(A2<C2,"Too low","")
Notice that IF requires three arguments, each separated by commas. The first argument (in this example, A2<C2) is the conditional test. If the test proves true, then the second argument (in this case, the test string "Too low") is used. If the test proves false, then the third argument (in this case, an empty string) is used. In other words, if the value in cell A2 is lower than the value in cell C2, then this formula returns the string "Too low." Otherwise, it returns an empty string.
You are not limited, of course, to returning strings in an IF function. You can return any value you want, including the values stored in other cells. For example:
=IF(A2<C2,B6-B7,43)
In this case, if A2 is less than C2, then the value derived by subtracting B7 from B6 is returned. If A2 is not less than C2, then the value 43 is returned.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10423) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Using the IF Worksheet Function.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
Finding a square root is easy because Excel provides a worksheet function for that purpose. Finding a different root may ...
Discover MoreFunctions are at the heart of Excel's power in working with data. One of the most misunderstood functions provided by ...
Discover MoreWhen applying trigonometry to the values in a worksheet, you may need to convert radians to degrees. This is done by ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments