How to Highlight an Entire Excel Row Based on This Week's Date
Question details
The user needs to dynamically highlight entire rows in a spreadsheet using conditional formatting when a date in a specific column falls within the current week.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking weekly schedules or tasks by automatically highlighting rows that correspond to the current week.
- Observed behavior
- The rows should change their background color dynamically as the current date shifts, based on the Monday date in column B.
Ensure your date column contains valid date formats and not text strings, as the WEEKNUM formula requires proper date values to function correctly.
Apply Conditional Formatting with the WEEKNUM Formula
Use a custom formula in the conditional formatting rules to evaluate if the date matches the current week, applying the format across the entire row.
To highlight an entire row rather than just a single cell, you must use a formula-based conditional formatting rule. The WEEKNUM function compares the week number of your date cell against the week number of today's date.
Highlight the entire range of data you want to apply the formatting to, ensuring you start from the first row of your actual data (e.g., A2 to Z100).
Navigate to the 'Home' tab on the ribbon, click on 'Conditional Formatting', and select 'New Rule' from the drop-down menu.
In the New Formatting Rule dialog box, click on 'Use a formula to determine which cells to format'.
Input the formula: =WEEKNUM($B2,2)=WEEKNUM(TODAY(),2) in the formula bar. Replace $B2 with the first cell of your date column.
Click the 'Format' button, go to the 'Fill' tab to choose your desired highlight color, and click 'OK' twice to apply the rule.

Highlight Rows by Date Effortlessly in WPS Spreadsheet
WPS Spreadsheet fully supports advanced conditional formatting rules, including dynamic date functions like WEEKNUM and TODAY. You can easily manage your weekly schedules with advanced features and a highly intuitive interface.
- 1. Open your spreadsheet: Launch WPS Spreadsheet and select the target cell range you want to highlight.
- 2. Access Conditional Formatting: Navigate to the 'Home' tab and click 'Conditional Formatting', then select 'New Rule'.
- 3. Apply the WEEKNUM formula: Select 'Use a formula to format cells' and input your WEEKNUM formula (e.g., =WEEKNUM($B2,2)=WEEKNUM(TODAY(),2)).
- 4. Customize and apply: Set your highlight color in the 'Format' dialog and click 'OK' to save the rule.

Frequently Asked Questions
Why is my conditional formatting only highlighting one cell instead of the entire row?
This happens if you forget to lock the column reference in your formula. Ensure you place a dollar sign before the column letter (e.g., $B2) so the rule evaluates only the date column across the entire row.
How do I highlight rows based on next week's date instead?
To highlight dates falling in the upcoming week, modify the right side of your formula to add 1 to the current week: =WEEKNUM($B2,2)=WEEKNUM(TODAY(),2)+1.
What if my work week starts on Sunday instead of Monday?
By default, the WEEKNUM function with a return_type of 2 starts the week on Monday. To start the week on Sunday, change the return_type to 1, making the formula: =WEEKNUM($B2,1)=WEEKNUM(TODAY(),1).
Can I highlight dates that match a specific month instead of a week?
Yes. You can change the formula to use the MONTH function instead of WEEKNUM. For example, entering =MONTH($B2)=MONTH(TODAY()) will highlight rows containing dates in the current month.




