Highlighting an Entire Row for the Current Date

Written by Allen Wyatt (last updated September 30, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Ronald has a worksheet with 365 or 366 rows, one for each day. The date is in column B. Using conditional formatting he can highlight the current date, but Ronald wonders how he can highlight the whole row for the current date.

This is relatively easy to do, provided you know a trick in setting your conditional formatting rule. Let's say that you have your data in the range of A1:T367, with the first row being used for column headings. You need to select all the rows that may have dates in them. So, in this case you would either select the range A2:T367, or simply select rows 2 through 367. (Either selection will work just fine.) Now, follow these steps:

  1. Make sure the Home tab of the ribbon is displayed.
  2. Click the Conditional Formatting tool. Excel displays a series of choices.
  3. Click New Rule. Excel displays the New Formatting Rule dialog box.
  4. In the Select a Rule Type area at the top of the dialog box, choose Use a Formula to Determine Which Cells to Format. (See Figure 1.)
  5. Figure 1. The New Formatting Rule dialog box.

  6. In the formula space, enter the following formula:
  7.      =$B2=TODAY()
    
  8. Click on the Format button. Excel displays the Format Cells dialog box.
  9. Use the controls in the dialog box to specify how you want your row formatted.
  10. Click OK to close the Format Cells dialog box.
  11. Click on OK to close the New Formatting Rule dialog box.

The "trick" I mentioned earlier is in step 5, when you define your formula. Remember that you started out by selecting a large range of cells or a large number of rows. That selection determines the cells to which the conditional formatting rule will be applied. However, the formula indicates that only the values in column B will be taken into consideration when evaluating the rule. This is the purpose of the dollar sign ($) it indicates an absolute column, one that doesn't change. Thus, all cells will be formatted when the formula is true, meaning that the date in column B is equal to today.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13389) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Inserting the Current Time with Seconds

If you need to insert the current time, with seconds, then you'll need the macro discussed in this tip. It's easy to use ...

Discover More

Tracked Changes Notification when Opening

If you have Word configured to show markup on-screen and you look through a document, it is easy to tell where changes ...

Discover More

Borders on Multiple Paragraphs with Differing Indents

When you place a border around a paragraph, the position of that border is determined, partially, by the indent with ...

Discover More

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!

More ExcelTips (ribbon)

Shading Rows with Conditional Formatting

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

Defining a Single Conditional Formatting Condition

Conditional formatting is a powerful tool you can use to dynamically adjust the formatting of your worksheet. This tip ...

Discover More

Returning a Value Based on Text Color

Conditional formatting rules can be used to adjust the way in which information is displayed in Excel, such as the text ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 5 - 3?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.