Conditional Formatting - To color following Mon as Public Holiday if Public Holiday falls on Sun

piyo27

New Member
Joined
Jan 9, 2019
Messages
13
Hi,

I have a workbook with 3 worksheets - 1st worksheet shows a yearly calendar, 2nd worksheet shows a list of course schedule, i.e. course name, course duration, start and end date, 3rd worksheet shows Public Holiday of that year.

Help needed to set a rule using conditional formatting to color the cell of following Mon on the yearly calendar if Public Holiday falls on Sun?

Rule to color cell for Public Holiday:=COUNTIF('Public Holiday'!$B$2:$B$12,B$4)>0
Rule to color cell for Weekend:=COUNTIF('Public Holiday'!$B$2:$B$12,B$4)>0

Thanks...
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
presumably you have a list of dates of public holidays in one column, in adjacent column put mondays date if a sunday, otherwise put the original date

now apply cond formatting on all course schedule sheets - if vlookup any date returns a different date color the cell
 
Upvote 0
Help needed to set a rule using conditional formatting to color the cell of following Mon on the yearly calendar if Public Holiday falls on Sun?

Hi, you could also try this small amendment to your current rule.

Rule to color cell for Public Holiday:=COUNTIF('Public Holiday'!$B$2:$B$12,B$4-1)>0
 
Upvote 0
Try this and all Public Holidays shifted

Hi, how about this further amendment then?

=AND(COUNTIF('Public Holiday'!$B$2:$B$12,B$4-1)>0,WEEKDAY(B$4)=2)
 
Last edited:
Upvote 0
Hi, how about this further amendment then?

=AND(COUNTIF('Public Holiday'!$B$2:$B$12,B$4-1)>0,WEEKDAY(B$4)=2)


Tried the above formula and all the color for Public Holiday disappeared. Btw, I managed to resolve this issue. Thanks so much for your help ;)
 
Upvote 0
Tried the above formula and all the color for Public Holiday disappeared

Oh, I thought you were after a new rule - to combine them you'd do something like.

=OR(AND(COUNTIF('Public Holiday'!$B$2:$B$12,B$4-1)>0,WEEKDAY(B$4)=2),COUNTIF('Public Holiday'!$B$2:$B$12,B$4)>0)

Btw, I managed to resolve this issue. Thanks so much for your help ;)

Great, good to hear :) feel free to post what you ended up using so other viewers of the thread can potentially benefit.
 
Last edited:
Upvote 0
Oh, I thought you were after a new rule - to combine them you'd do something like.

=OR(AND(COUNTIF('Public Holiday'!$B$2:$B$12,B$4-1)>0,WEEKDAY(B$4)=2),COUNTIF('Public Holiday'!$B$2:$B$12,B$4)>0)

Great, good to hear :) feel free to post what you ended up using so other viewers of the thread can potentially benefit.

Oops I thought u meant replacing my existing code. Oh I tried the above formula and it works!

What I did previously was add 2 columns, i.e. C and D, in Public Holiday worksheet to reflect the day in column C and the the following Mon date in column D. After which, include a formula in conditional formatting to pick up date in column D and reflect the color in the cell accordingly. It's kind of a workaround. You solution is more directly and I have adopted that. Thanks so much for your help :-D
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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