Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Conditionally Formatting Non-Integers.
by Allen Wyatt
(last updated December 15, 2018)
Makik has a list of numeric values. Some are integers; some have digits to the right of the decimal. He would like to use conditional formatting to highlight those values that have digits to the right of the decimal point.
There are a large number of ways that this can be done, and a number of different approaches. I won't go into how to define a conditional format here; such information has already been covered in other issues of ExcelTips. Instead I'll focus on the condition itself and how you should select the condition to test.
If you know that the list will only contain numeric values, then you could use any number of formulas to determine whether the value is a non-integer. These are just a few that can be used if you specify that the condition contains a formula:
The various formulas (and there could be many more listed) basically check to see if the unaltered value in the cell is equal to a version that makes sure there is nothing to the right of the decimal.
If you prefer (for some reason) to not rely upon a formula to define your condition, then you can choose "cell value is greater than" and set the condition as ROUNDDOWN(A1,0). You could also use "not equal to" in the condition and you could change ROUNDDOWN to ROUNDUP. Either way, you are testing to determine whether a rounded version of the number (rounded to the nearest integer) is equal to the original value or not.
You should note that if any integer value in your list is formatted with decimal places, then such a value won't be "caught" by these conditional formats. For instance, if a cell contains the value 41 but the cell is formatted to display the value as 41.00, that value won't be "marked" by the conditional format as having something to the right of the decimal point. The reason is that the value really is an integer; it is just the display that adds the decimal point and two zeros.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8484) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Conditionally Formatting Non-Integers.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Conditional formatting can be used to draw your attention to certain cells based on what is within those cells. This tip ...Discover More
Conditional formatting is a great tool you can use to customzie your worksheets. When you want to test whether a value in ...Discover More
If you need to shade alternating rows in a data table, you'll want to examine how you can accomplish the task with ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.