Lux Aeterna
Board Regular
- Joined
- Aug 27, 2015
- Messages
- 205
- Office Version
- 2019
- Platform
- Windows
I have a calendar setup in Excel where the first day of the month is dynamically placed in the first cell (C4). The subsequent cells (E4, G4, I4, K4, M4, O4) are populated with the following formulas. However, when the first day of the month falls on a Saturday or Sunday, the first day of the month is skipped, and I need to prevent this from happening.
The issue is that if the first day of the month is either a Saturday or Sunday, it is skipped and the formula doesn't place it correctly in the first available cell.
For example, in June 2024, cell C4 shows June 3rd, but it should be blank. Instead, cell M4 should display June 1st.
Here are the current formulas:
C4 (First Cell):
E4 (Second Cell):
G4 (Third Cell):
I4 (Fourth Cell):
K4 (Fifth Cell):
I wrote the formulas for M4 and O4 myself, so they might be incorrect.
M4 (Sixth Cell):
O4 (Seventh Cell):
Thank you in advance!
The issue is that if the first day of the month is either a Saturday or Sunday, it is skipped and the formula doesn't place it correctly in the first available cell.
For example, in June 2024, cell C4 shows June 3rd, but it should be blank. Instead, cell M4 should display June 1st.
Here are the current formulas:
C4 (First Cell):
Excel Formula:
=IF(WEEKDAY(DATE(YEAR(U4),MONTH(U4),1),16)<4,DATE(YEAR($U$4),MONTH($U$4),1)+(3-WEEKDAY(DATE(YEAR(U4),MONTH(U4),1),16)),"")
E4 (Second Cell):
Excel Formula:
=IF(C4="",IF(WEEKDAY(DATE(YEAR(U4),MONTH(U4),1),16)=4,DATE(YEAR($U$4),MONTH($U$4),1),""),C4+1)
G4 (Third Cell):
Excel Formula:
=IF(E4="",IF(WEEKDAY(DATE(YEAR(U4),MONTH(U4),1),16)=5,DATE(YEAR($U$4),MONTH($U$4),1),""),E4+1)
I4 (Fourth Cell):
Excel Formula:
=IF(G4="",IF(WEEKDAY(DATE(YEAR(U4),MONTH(U4),1),16)=6,DATE(YEAR($U$4),MONTH($U$4),1),""),G4+1)
K4 (Fifth Cell):
Excel Formula:
=IF(I4="",IF(WEEKDAY(DATE(YEAR(U4),MONTH(U4),1),16)=7,DATE(YEAR($U$4),MONTH($U$4),1),""),I4+1)
I wrote the formulas for M4 and O4 myself, so they might be incorrect.
M4 (Sixth Cell):
Excel Formula:
=IF(K4="",IF(WEEKDAY(DATE(YEAR(U4),MONTH(U4),1),16)=7,DATE(YEAR($U$4),MONTH($U$4),1),""),K4+1)
O4 (Seventh Cell):
Excel Formula:
=IF(M4="",IF(WEEKDAY(DATE(YEAR(U4),MONTH(U4),1),16)=7,DATE(YEAR($U$4),MONTH($U$4),1),""),M4+1)
Thank you in advance!