Setting up Observed Holidays on a Dynamic Calendar based upon the year

Joined
Dec 8, 2021
Messages
26
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Ok, I am very sorry but I cannot get the XL2BB tool to work for me these days. Excel keeps blocking it and after a few tries following the "how-to" I've decided to post a screenshot with my question.
I am trying to make my mom this calendar/vacation accrual calculator worksheet. If someone uses 8 hours of VAC or whatever other types of "Leave" sh will input the number of hours on this sheet under the correct month/date and I've set up the formulas to add the accruals and subtract the time used (that's the easy part). Here is a screenshot:

1651609571501.png

This is set to adjust the dates based upon the year which she types up in the year cell in the left corner.

Formula for the days to adjust are in the rows of dates, for example, Feb (row 42) the first Monday is a blank cell here is the formula: =IF(WEEKDAY(A42,1)=$I$4, A42,"")
For the following day Feb 1st under Tuesday formula is: =IF(B42="",IF(WEEKDAY(A42,1)=MOD($I$4,7)+1,A42,""),B42+1)
I there a way to maybe use conditional formatting to highlight the Holidays for the year based upon that specific year. See here if a holiday lands on a Sunday we observe it on that following Monday or if a holiday falls on a Saturday it is observed on Friday before. They are paid holiday pay so she would like to track that but I am not sure how to set that up for her.
Wanted to bring this one to you all to see what you think.
IF you need more info let me know and I will try to post the XL2BBB
 
You are so nice! thank you VERY much



I noticed that the vertical gray bars denoting weekends do not shift correctly when, for example, you change the start-of-week option in I4 from Monday to Sunday. Here is an idea using conditional formatting that determines whether a number is in row 10 and an "S" is in row 9. If so, then the cells are shaded and the font colors adjusted as necessary. Before implementing this, you will want to select B10:B21 and click on the "paint brush" Format Painter and then swipe across your entire range or C:AL. Then apply the conditional formatting rules to handle the row heading formats, and vertical bar formats for weekends and holidays.
MrExcel_20220503.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKAL
1Accruals
2
3YearMonthStart Day
42021211: Sunday, 2: Monday
5VacationPersonal Holiday
6NAME:EE:Accrual Level:7Accrual Level:C
72021-2022
8[42]
9SMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSM
10Feb-2021 12345678910111213141516171819202122232425262728        
11Personal Holiday1
12Vacation
13Sick Leave
14Family Sick Leave2
15Admin Leave4
16Bereavement
17Vacation in Lieu of Sick
18FMLA
19PDL
20OPT
21OVT
YearlyCalendar
Cell Formulas
RangeFormula
A7A7=IF($C$4=1,A4,A4&"-"&A4+1)
B9B9=CHOOSE(1+MOD($I$4+1-2,7),"S","M","T","W","T","F","S")
C9C9=CHOOSE(1+MOD($I$4+2-2,7),"S","M","T","W","T","F","S")
D9D9=CHOOSE(1+MOD($I$4+3-2,7),"S","M","T","W","T","F","S")
E9E9=CHOOSE(1+MOD($I$4+4-2,7),"S","M","T","W","T","F","S")
F9F9=CHOOSE(1+MOD($I$4+5-2,7),"S","M","T","W","T","F","S")
G9G9=CHOOSE(1+MOD($I$4+6-2,7),"S","M","T","W","T","F","S")
H9H9=CHOOSE(1+MOD($I$4+7-2,7),"S","M","T","W","T","F","S")
I9:AL9I9=B9
A10A10=DATE($A$4,$C$4,1)
B10B10=IF(WEEKDAY(A10,1)=$I$4,A10,"")
C10C10=IF(B10="",IF(WEEKDAY(A10,1)=MOD($I$4,7)+1,A10,""),B10+1)
D10D10=IF(C10="",IF(WEEKDAY(A10,1)=MOD($I$4+1,7)+1,A10,""),C10+1)
E10E10=IF(D10="",IF(WEEKDAY(A10,1)=MOD($I$4+2,7)+1,A10,""),D10+1)
F10F10=IF(E10="",IF(WEEKDAY(A10,1)=MOD($I$4+3,7)+1,A10,""),E10+1)
G10G10=IF(F10="",IF(WEEKDAY(A10,1)=MOD($I$4+4,7)+1,A10,""),F10+1)
H10H10=IF(G10="",IF(WEEKDAY(A10,1)=MOD($I$4+5,7)+1,A10,""),G10+1)
I10:AL10I10=IF(H10="","",IF(MONTH(H10+1)<>MONTH(H10),"",H10+1))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B10:AL10Expression=AND(ISNUMBER(B$10),B$9="S")textNO
B11:AL21Expression=AND(ISNUMBER(B$10),B$9="S")textNO
B10:AL21Expression=ISNUMBER(MATCH(DATE(YEAR($A$10),MONTH($A$10),DAY(B$10)),Holidays!$C$3:$C$10,0))textNO
B10:AL10Expression=ISNUMBER(B$10)textNO

For reference, the dark gray is color hex code: #595959 and white font
light gray is: #D9D9D9 and black font
yellow is standard: #FFFF00 and black font
light blue is: #D3EBF3 and black font
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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