Reputation: 109
My objective is to have 1 formula (better) or macro that can automatically generate all weekdays from a given day cell reference until today (included).
Say I have a A1 cell with "2022-01-01", how can I generate a column with values that will include all weekdays until today? (this will be a dynamic length as everyday is updated)
Like:
Edit: using Office 2019 so SEQUENCE() function not working
Upvotes: 0
Views: 195
Reputation: 152450
put this in your first cell:
=WORKDAY(A1-1,SEQUENCE(NETWORKDAYS(A1,TODAY())))
This requires the dynamic array formula Sequence. It will spill the results down.
With out SEQUENCE, put this in the first cell and copy down till you get blanks and beyond if you want each new day to continue to appear:
=IF(WORKDAY(A1-1,ROW($ZZ1))>TODAY(),"",WORKDAY(A1-1,ROW($ZZ1)))
Upvotes: 3