Need a formula that will allow me to highlight a spreadsheet column.

Clay McCall 40 Reputation points
2026-10-27T14:37:37.97+00:00

I have a Excel workbook with several sheets that I use to track my budget at home. One sheet is for Income from my job. Each column represents a pay period and pay date within each month. One row in each column has the date for the pay date for that period. I would like to highlight the column for the last pay date based on the date for Today()'s date when I access that sheet. Example: Pay date = 10/22/2026, Today()'s date is 10/27/2026. The next pay date is 11/05/2026. I have been unable so far to figure out how to do this. I can't use the Column()-1 matchup because each Month has 2-4 payment dates (includes Bonuses). Any suggestions? Would appreciate any help?

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

Answer accepted by question author
Adeel Khan 650 Reputation points
2026-10-27T14:45:32.6266667+00:00

Hi Clay,

I would do this with a conditional formatting rule based on a formula, rather than a formula in a cell.

Say your pay dates sit in row 2, in columns B to Z, and the data you want to highlight runs from row 2 down to row 100. Adjust the row and column letters to match your sheet.

  1. Select the range B2:Z100.
  2. Go to Home, then Conditional Formatting, then New Rule.
  3. Choose "Use a formula to determine which cells to format".
  4. Enter this formula:

=B$2=MAXIFS($B$2:$Z$2,$B$2:$Z$2,"<="&TODAY())

  1. Click Format, pick the fill colour you want, then click OK twice.

How it works: MAXIFS finds the latest pay date that is on or before today, and the rule highlights every cell in the column whose date in row 2 matches it. The $ before the 2 keeps the test on the pay date row, while the column letter stays relative so each column is tested against its own date. This also handles months with 2 to 4 pay dates, since it always picks the latest one that has already happened.

Two things to check if it does not work: make sure the pay dates are real dates and not text, and check the "Applies to" range in the Conditional Formatting Rules Manager matches the range you selected.

If your pay dates are in a different row, change the 2 in B$2 and $B$2:$Z$2 to that row number.

Thanks!

Was this answer helpful?

2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.