saracat2012
New Member
- Joined
- Jun 27, 2023
- Messages
- 11
- Office Version
- 365
- Platform
- Windows
Hello again wonderful people. I have a partially automated calendar Excel file I track my time off hours in for work. I've been upgrading it a little at a time, as I learn new functionality and I've gotten to a point that seems to be very close, but is stumping me. I've extracted the relevant portion. I'm trying to get the yellow cells to auto-populate the dates when I change the year in the a reference cell (green one for this example). The array has formulas that calculate the date of specific holidays based on the year (1st section), uses a UCF to show what day the holiday falls on (2nd section), and which days the company grants for those holidays (3rd section). How do I use this information correctly to achieve the stated goal?
Bonus scenario (orange cells): The holiday given around the 4th of July changes depending on the relationship to the weekend. Ex: If 7/4 falls on a Thursday, 7/5 is given off. If it falls on a Tuesday, 7/3 is given off. This is reflected in the 3rd section of the array (the days that are given off say the name of the day). How do I make it auto-populate the holiday label (orange cells), based on the year?
As always, TIA.
Bonus scenario (orange cells): The holiday given around the 4th of July changes depending on the relationship to the weekend. Ex: If 7/4 falls on a Thursday, 7/5 is given off. If it falls on a Tuesday, 7/3 is given off. This is reflected in the 3rd section of the array (the days that are given off say the name of the day). How do I make it auto-populate the holiday label (orange cells), based on the year?
As always, TIA.
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:G2 | C2 | =DATE(C1,1,1) |
C3:G3 | C3 | =DATE(C1,1,1)+14+CHOOSE(WEEKDAY(DATE(C1,1,1)),1,0,6,5,4,3,2) |
C4:G4 | C4 | =DATE(C1,2,1)+14+CHOOSE(WEEKDAY(DATE(C1,2,1)),1,0,6,5,4,3,2) |
C5:G5 | C5 | =DATE(C1,6,1)-WEEKDAY(DATE(C1,6,6)) |
C6:G6 | C6 | =DATE(C1,7,3) |
C7:G7 | C7 | =DATE(C1,7,4) |
C8:G8 | C8 | =DATE(C1,7,5) |
C9:G9 | C9 | =DATE(C1,9,1)+CHOOSE(WEEKDAY(DATE(C1,9,1)),1,0,6,5,4,3,2) |
C10:G10 | C10 | =DATE(C1,11,1)+21+CHOOSE(WEEKDAY(DATE(C1,11,1)),4,3,2,1,0,6,5) |
C11:G11 | C11 | =DATE(C1,11,1)+22+CHOOSE(WEEKDAY(DATE(C1,11,1)),4,3,2,1,0,6,5) |
C12:G12 | C12 | =DATE(C1,12,24) |
C13:G13 | C13 | =DATE(C1,12,25) |
C15:G26 | C15 | =mydayname(C2) |
C28:G28 | C28 | =IF(mydayname(C2)="Saturday",mydayname(C2+2),IF(mydayname(C2)="Sunday",mydayname(C2+1),mydayname(C2))) |
C29:G31,C35:G37 | C29 | =mydayname(C3) |
C32:G32 | C32 | =IF(mydayname(C7)="Tuesday",mydayname(C6),IF(mydayname(C7)="Wednesday",mydayname(C6),IF(mydayname(C7)="Saturday",mydayname(C6),IF(mydayname(C7)="Sunday",mydayname(C6-1),"")))) |
C33:G33 | C33 | =IF(mydayname(C7)="Saturday","Monday",IF(mydayname(C7)="Sunday","",mydayname(C7))) |
C34:G34 | C34 | =IF(mydayname(C7)="Monday", mydayname(C8), IF(mydayname(C7)="Thursday", mydayname(C8), IF(mydayname(C7)="Friday", mydayname(C8+2), IF(mydayname(C7)="Sunday", mydayname(C8), " ")))) |
C38:G38 | C38 | =IF(mydayname(C12)="Saturday",mydayname(C12-1),IF(mydayname(C12)="Sunday",mydayname(C12+1),mydayname(C12))) |
C39:G39 | C39 | =IF(mydayname(C13)="Sunday",mydayname(C13+1),IF(mydayname(C13)="Monday",mydayname(C13+1),IF(mydayname(C13)="Saturday",mydayname(C13+6),mydayname(C13)))) |