Need help with conditional formatting while creating a calendar

RonOliver

Board Regular
Joined
Aug 30, 2022
Messages
82
Office Version
  1. 365
Platform
  1. Windows
Hi, everyone!

Book1
ABCDEFGHIJ
1September 20229/1/2022
2MTWRFSU
32930311234List of dates
4567891011StartEnd
5121314151617189/2/2022
6192021222324259/5/2022
72627282930129/10/20229/15/2022
8       9/21/20229/23/2022
99/25/2022
109/28/20229/30/2022
Sheet1
Cell Formulas
RangeFormula
A1A1=DATE(YEAR(I1),MONTH(I1),1)
A3A3=EOMONTH(A1,-1)-(WEEKDAY(A1,2)-1)+1
B3:G7B3=A3+1
A4:A7A4=G3+1
A8A8=IF(MONTH(G7+1)<>MONTH(A1),"",G7+1)
B8:G8B8=IF(A8="","",A8+1)


This is my problem. My calendar is in columns A to G. I1 is the value where I want my calendar to start and columns I and J include a list of dates and periods. I want Excel to highlight the dates in the calendar if they match the values in the list or if they are found within a period from that list. If the cell in column J has a "—", it is a specific date. If the cell in column J has a date, that means it is a period. For example, in the case of cells I7 and J7, I want Excel to highlight all the dates in the calendar ranging from Sept 10 to Sept 15.

The formula shouldn't be very difficult, but I'm struggling to get it to work and keep it concise (I really wouldn't want a hundred rules in Conditional Formatting). Could you please help me with this? Thanks!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
How about
Cell Formulas
RangeFormula
A1A1=DATE(YEAR(I1),MONTH(I1),1)
A3A3=EOMONTH(A1,-1)-(WEEKDAY(A1,2)-1)+1
B3:G7B3=A3+1
A4:A7A4=G3+1
A8A8=IF(MONTH(G7+1)<>MONTH(A1),"",G7+1)
B8:G8B8=IF(A8="","",A8+1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:G7Expression=OR(COUNTIFS(A3,$I$5:$I$10),COUNTIFS(A3,">="&$I$5:$I$10,A3,"<="&$J$5:$J$10))textNO
 
Upvote 1
Solution
How about
Cell Formulas
RangeFormula
A1A1=DATE(YEAR(I1),MONTH(I1),1)
A3A3=EOMONTH(A1,-1)-(WEEKDAY(A1,2)-1)+1
B3:G7B3=A3+1
A4:A7A4=G3+1
A8A8=IF(MONTH(G7+1)<>MONTH(A1),"",G7+1)
B8:G8B8=IF(A8="","",A8+1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:G7Expression=OR(COUNTIFS(A3,$I$5:$I$10),COUNTIFS(A3,">="&$I$5:$I$10,A3,"<="&$J$5:$J$10))textNO
Works like a charm. It was indeed much easier to do than I wanted it to be. Thank you so much!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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