It is Ok to ask questions. That is why the forum exists,
In the January 2023 cell I don't understand =DATE(B1,MONTH(--(1&B2)),1)
With this example, the year is specified in one cell B1 and the month is specified in B2.
The Date function uses a number for the month. Text of say January or Jan can be coerced to a number by the MONTH(--(1&B2)).
I have other questions like what dt and D2 are...variables?
Let save the information as a variable
LET(d,A1-DAY(A1)+1,dt,SEQUENCE(6,7,WORKDAY.INTL(d+1,-1,"1111110"),1)
d= A1-DAY(A1)+1 which calculates the first day of the month
dt= the sequence information
6 number of rows
7 number of columns
WORKDAY.INTL(d+1,-1,"1111110") calculates the first Sunday
1 increment by 1
What part of the formula tells it to start on Sunday? WORKDAY.INTL(d+1,-1,"1111110") calculates the first Sunday
d is the date of the 1st of the month. I added one in case the 1st of the month is a Sunday and the -1 to find the previous Sunday
d2 in post #3 is the calculated date Jan 1 2023 custom formatted to mmm yyyy
Recommendation for each part of the formula, prepare an example and review it with Excels Formula Evaluate.
Then build a solution with your preferences.
I appreciate all of your updates, but my knowledge is pretty rudimentary.
So, if we could stick with this formula you posted:
=LET(dt,SEQUENCE(6,7,WORKDAY.INTL(D2+1,-1,"1111110"),1),IF(dt-DAY(dt)+1=D2,dt,""))
I read your post and have been working on it endlessly
USING THIS FORMULA
=LET(dt,SEQUENCE(6,7,WORKDAY.INTL(D2+1,-1,"1111110"),1),IF(dt-DAY(dt)+1=D2,dt,""))
My read is that:
1 this translates to 7 columns by 6 rows
2 the D2+1,-1 I don't understand..I read your reasoning but don't understand...is the D2+1,-1 the Sundays you are referring to? Why do you need to add 1 if the 1st is a Sunday or subtract 1 for the previous Sunday? And why is the + or - 1 treated as a week in the formula if my "reasoning" is right?
3 the 1111110 translates to counting Sundays and incrementally counting Sundays by 1...so if 1/1/23 is a Sunday, it would next yield 1/8/23 as a Sunday?
4 How does the formula know which day of the week to start on in any given month?
As always
Many thanks