Written by Allen Wyatt (last updated May 1, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
Tom has a worksheet that contains start times and end times for jobs. All times are entered in 24-hour notation. He needs a way to highlight any time that is after 17:00 (5:00 pm) or before 08:00 (8:00 am).
This is precisely the situation in which Conditional Formatting really shines. How you put together the formatting rules, though, depends on how your data is set up and what, exactly, you want to highlight.
Let's say that Tom's data is in columns A and B. In column A he enters a start time and in column B he enters the end time. If Tom wants to highlight only those start times that are in the after-hours range, he could follow these steps:
Figure 1. The New Formatting Rule dialog box.
If you wanted to highlight either start or end times that are in the after-hours range, all you have to do is to select both columns A and B in step 2.
When you are specifying your formatting (step 11), I suggest that you don't use a format that fills the interior of the cell with a color. This is because if the cell is blank, it will always meet the test you defined in steps 7-10. (A blank cell would be considered a time of 00:00, which is midnight and therefore after hours.)
If you want a Conditional Format that will check for the blank cells, then you can follow these steps:
The formula in step 7 assumes that the range of cells you selected in step 2 has cell A1 at the upper-left corner of the range. If your range has a different cell in that position, make sure you adjust the formula in step 7 to reflect that difference.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13853) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
Conditional formatting allows you to change how information is displayed based on rules you define. What if you want to ...
Discover MoreWhen you apply conditional formatting to the cells in your worksheet, those rules can seem a bit fragile at times. For ...
Discover MoreNeed to have a sound played if a certain condition is met? It is rather easy to do if you use a user-defined function to ...
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 © 2024 Sharon Parq Associates, Inc.
Comments