How to Change the Color of Weekends with Conditional Formatting in 5 Simple Steps
- Create a test for the weekend days: Use the WEEKDAY function to check if a day falls on a weekend.
- Open Conditional Formatting: Go to Conditional Formatting > New Rule in the menu.
- Select a custom formula: In the dialog, choose Use a formula to determine which cell to format.
- Enter the formula: Type =WEEKDAY(B1, 2)>5 to highlight weekends (Saturday and Sunday).
- Choose a color for weekends: Click Format, select Fill, pick a color, and confirm with OK.
Automatic Calendar
Here is a calendar showing how to color weekends. Each day in row 1 uses the DATE function to create a date according to the date in A1.

Step 1: Set Up the WEEKDAY Test
Use WEEKDAY function to identify weekends (1 for Sunday, 2 for Monday).
Step 2: Add Conditional Formatting Rule
In Conditional Formatting, select Use a formula to determine which cell to format.
Step 3: Apply the Formula
Enter =WEEKDAY(B$1, 2)>5 in the text box to highlight weekends.
Step 4: Set Your Custom Color
Then, to change the weekend’s color, you must set a color only with the test of the formula that will return TRUE.
- Click Format and choose a color for weekends.
- Go to Fill tab
- Pick a color for the weekends and click OK.
Step 5: Apply to a Range of Cells
In Conditional Formatting> Manage Rules, extend the rule to cover the whole range.

Change the Color of Public Holidays
Highlight public holidays with the COUNTIF function, as explained here.

- Highlight Date Outside the Deadline
- Calculate Public holidays with Excel 📆
- Identifying Weekdays and Weekends with Excel
- Use 2 Different Highlight Colors in Excel
- Automatically Highlight Birthdays
- How to Highlight Min and Max values in Excel
Practice with exercises
Related articles
- Identifying Weekdays and Weekends with Excel
- Change the default Date format in Excel
- Function DATE – YEAR – MONTH – DAY
- Converting a Date from YYYYMMDD to DD/MM/YYYY in Excel
Practice this function
Reading is a good start, but practice is how you remember. These exercises are based on real questions from Excel forums, with instant correction.
17/04/2019 @ 17:27
please help me. I have been working on this for 4 hours. I need to know how to write formula to highlight current month and next month in yellow, and highlight a month or any month that is out of date for the month in red. i am tracking upcoming license plate renewals. I want a two month warning and any month past due in red. I prefer to use an icon but a cell highlight is fine.