Forum Discussion
Dele65
Dec 30, 2022Copper Contributor
Excel Formula
Hi I am new to this platform. am also new to excel. Kindly let me know what is wrong with this formula =SEQUENCE(52, 7, 2023). I wanted to produce 2023 calendar. thanks
Patrick2788
Dec 30, 2022Silver Contributor
I believe you'd have to add a 53rd row to show 12/31/2023. If you're building this formula to accommodate future years, 2024 has a leap year so the 53rd row would include (2) 2023 dates.
Try this:
=LET(y,2023,start,DATE(y,1,1),SEQUENCE(53,7,start))
mtarler
Dec 30, 2022Silver Contributor
Dele65 In addition to the above I assume you want to start on a Sunday so you want to offset that start day accordingly (which this coming year happens to start on a Sun):
=LET(a,DATE(2023,1,1), b,WEEKDAY(a,1)-1, SEQUENCE(53,7,a-b))
EDIT:
I just saw your reply and it sounds like you don't have SEQUENCE function. What version of Excel do you have? If you don't have dynamic arrays (I believe Excel 2021+) then you will need to do something like:
=DATE(2023,1,1)-WEEKDAY(DATE(2023,1,1),1)+1+7*(ROW()-ROW($A$1))+COLUMN()-COLUMN($A$1)
where you enter the Date/Year 2x and the upper left corner of your 'calendar' in 2x (where the $A$1 are located and make sure to include those $) and then fill/copy right and down