Excel guide · 5 min read
How to highlight weekends in Excel
=WEEKDAY(B$1,2)>5 when the dates run across row 1 (or =WEEKDAY($A2,2)>5 when they run down column A). WEEKDAY with return type 2 numbers Monday 1 to Sunday 7, so >5 means Saturday or Sunday.Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Staff | Nov 26, 2026 | Nov 27, 2026 | Nov 28, 2026 | Nov 29, 2026 | Nov 30, 2026 | Dec 1, 2026 | Dec 2, 2026 | Thu 3 | Closed days | |
| 2 | Priya | Off | Early | Late | Off | Early | Early | Late | Off | Nov 26, 2026 | |
| 3 | Marcus | Early | Off | Early | Late | Off | Late | Early | Early | Dec 24, 2026 | |
| 4 | Elena | Late | Late | Off | Early | Late | Off | Off | Late |
Download this sheet as an Excel practice file (.xlsx)
Dates across the top: the B$1 rule
A staff rota, a project plan or a monthly calendar usually has the dates across a header row and people or tasks down the side. Shading the weekend columns makes the week pattern jump out, and it moves with the dates when you roll the rota forward.
The rota below has dates in B1:H1 and shifts in B2:H4. WEEKDAY(date,2) returns 1 for Monday up to 7 for Sunday, so the test is simply >5. Across the header it gives FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE: Saturday 28 and Sunday 29 November.
- Select the whole block, starting from the top-left date: B1:H4.
- Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format.
- Enter
=WEEKDAY(B$1,2)>5 - Click Format, pick a light fill on the Fill tab, and click OK twice.
Result: spills 1 row × 7 columns
| FALSE | FALSE | TRUE | TRUE | FALSE | FALSE | FALSE |
TRUE only for 28 and 29 November, the Saturday and Sunday columns.
Why the $ goes before the 1, and the blank-cell trap
The formula is written for the top-left cell of your selection, and Excel shifts it for every other cell. B$1 locks the row but not the column, so every cell in column D looks at D1, every cell in column E looks at E1, and whole columns light up. With $B$1, every cell looks at Thursday 26 November and nothing is shaded. With plain B1, row 2 looks at B2 ("Off"), WEEKDAY returns #VALUE!, and conditional formatting treats an error as "don't format".
Now the trap. If your selection runs past the last date, the empty header cells get shaded too. Excel treats a blank cell as 0, day zero of its calendar, and WEEKDAY calls that a Saturday: =WEEKDAY(J1,2) on an empty cell returns 6. Use =AND(B$1<>"",WEEKDAY(B$1,2)>5) so blank columns stay white. That's handy for a template where next month has fewer days.
For a list with dates down column A instead, lock the column: =WEEKDAY($A2,2)>5 shades whole rows. weekday-or-weekend-in-excel shows that layout with a helper column too.
Result: 6
6 (Saturday) for an empty cell, so a blank header column would be shaded without the B$1<>"" check.
Shade holidays and closed days too
Weekends are rarely the only days off. List the closed days in a column (K2:K3 here) and add a COUNTIF test, which returns 1 or more when the header date is in the list. Thursday 26 November is in the list, so its column is shaded even though it's a weekday.
If holidays should get a different colour, make them a second rule instead of combining them. Home > Conditional Formatting > Manage Rules lists the rules in order, and when two rules set the same fill, the one higher in the list wins. Put the holiday rule on top.
Result: TRUE
TRUE for 26 November: it's a Thursday, but it is in the closed-days list.
Friday-Saturday weekends and one day off
Not every team's weekend is Saturday and Sunday. WEEKDAY without a return type numbers Sunday 1 to Saturday 7, so =WEEKDAY(B$1)>5 matches Friday (6) and Saturday (7), the weekend in many Middle Eastern countries. To shade Sundays only, use =WEEKDAY(B$1)=1. For any other pattern, test the days you want with OR, for example =OR(WEEKDAY(B$1)=1,WEEKDAY(B$1)=4) for Sundays and Wednesdays.
Pick one numbering and stick with it. Mixing return type 2 (Monday 1) in one rule with the default (Sunday 1) in another is the usual reason a rule shades the wrong column.
Result: spills 1 row × 7 columns
| FALSE | TRUE | TRUE | FALSE | FALSE | FALSE | FALSE |
TRUE for Friday 27 and Saturday 28 November with the default Sunday-first numbering.
Header dates typed as text never match
The last header, I1, was typed as "Thu 3". It looks like a date but it's text: =ISNUMBER(I1) is FALSE and WEEKDAY(I1,2) returns #VALUE!, so the rule silently skips that column. This is the most common reason a weekend rule "works for some columns".
Type or calculate real dates and change only how they look. Select the header, press Ctrl+1, choose Custom and type ddd d. The cells still hold dates, so the rule works, and they show as Thu 26, Fri 27, Sat 28. To roll the rota forward, put the first date in B1 and =B1+1 in C1, then fill right.
Once the dates are real, you can count weekend work too. =SUMPRODUCT((WEEKDAY(B1:H1,2)>5)*(B2:H4<>"Off")) returns 4 weekend shifts worked, which helps when you share weekends fairly across the team.
Result: spills 1 row × 7 columns
| Thu 26 | Fri 27 | Sat 28 | Sun 29 | Mon 30 | Tue 1 | Wed 2 |
Thu 26, Fri 27, Sat 28, Sun 29, Mon 30, Tue 1, Wed 2: what the ddd d format shows while the cells stay real dates.
Common mistakes
Selecting from the wrong cell
The rule is relative to the active cell of the selection. Select from the top-left (B1) and write the formula for that cell, or the shading lands one column off.
Locking both parts with $B$1
Every cell then tests the same date, so all or nothing is shaded. Use B$1 for dates across the top and $A2 for dates down the side.
Empty columns shaded as Saturday
WEEKDAY of a blank cell is a Saturday. Add a B$1<>"" test with AND.
Header dates stored as text
Text like "Thu 3" never matches. Enter real dates and use a ddd d custom format to show the day name.
FAQ
How do I highlight weekends in an Excel calendar?
Select the calendar, add a conditional formatting rule with Use a formula, and enter =WEEKDAY(B$1,2)>5 if the dates are in row 1. Write it for the top-left cell of your selection.
How do I highlight weekend rows in Excel?
When the dates are in column A, use =WEEKDAY($A2,2)>5 on a selection that starts in row 2. The $ before A keeps every cell in the row looking at the date column.
How do I highlight weekends and holidays in Excel?
List the holidays in a range and use =OR(WEEKDAY(B$1,2)>5,COUNTIF($K$2:$K$10,B$1)>0), or add a second rule just for holidays so they get their own colour.
Why is my weekend conditional formatting not working?
Usually the dates are text, the $ signs are in the wrong place, or the formula was written for a different cell than the top-left of the selection. Check with =ISNUMBER on a header cell first.
Functions used
WEEKDAYDay of the week as a numberANDTrue if all tests are trueORTrue if any test is trueCOUNTIFCounts cells that matchISNUMBERIs it a number?TEXTNumber to formatted textSUMPRODUCTMultiply then add
Related guides
- Check if a date is a weekend in Excel
- Highlight overdue and upcoming dates in Excel
- Highlight an entire row based on one cell's value
- Conditional formatting formula not working: how to fix it
- How to use a custom formula in Excel Data Validation
- How to find missing numbers in a sequence in Excel
Updated