Change the background color of a cell if it is a weekend

exceltadpole

Board Regular
Joined
Jan 14, 2004
Messages
108
Column D has dates for one month in the format "mmm dd, yyyy - ddd" in cells D1, D2 ... D30:
Sept 01, 2007 - Sat
Sept 02, 2007 - Sun
Sept 03, 2007 - Mon
Sept 04, 2007 - Tue
.....
Sept 30, 2007 - Sun


I want to change the background color of the cells E1:G1 if D1 is a weekend.
In other words, if D2 has a Sat or a Sun then E2:G2 should have a yellow background.
Keeping in mind that cells in the range E2:G2 already contain data.

How can I do this?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Select the range E1:G30 with E1 active cell

Format > Conditional formatting > formula is

=(WEEKDAY($D1,2)>5)*($D1<>"")

select desired pattern, OK
 
Upvote 0
Try Conditional Formatting (under the Format Menu). Select E1 through G1. Then do menu Conditional Formatting. Change the drop down from "Cell Value Is" to "Formula Is" and use the following format:
Code:
=WEEKDAY($D1,2)>5
Then change the pattern to show a Yellow color.
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,267
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top