i need to generate in automatic and in single row all days of a gived months. For example, if month is October i need:
ROW | DATE | DAY | NOTE |
---|---|---|---|
1 | 01/10/2022 | Saturday | ... |
2 | 02/10/2022 | Sunday | ... |
3 | 03/10/2022 | Monday | ... |
... | ... | ... | ... |
30 | 30/10/2022 | Sunday | ... |
31 | 31/10/2022 | Monday | ... |
How i can to do it? Some macro? Thanks very much.
CodePudding user response:
Sharing as an alternative to VBA. Custom formula created using LAMBDA()
• Formula used in cell B4
=DATE.SERIES(C2)
The Excel LAMBDA()
function gives us a way create custom functions that can be reused throughout a workbook, without using VBA, with a friendly name.
The formula used in Name Manager as shown below with testing syntax
=LAMBDA(text,
LET(_month,MONTH(text&0),
_firstDay,DATE(2022,_month,1),
_lastDay,EOMONTH(_firstDay,0),
_dates,SEQUENCE(DAY(_lastDay),,_firstDay),
_day,TEXT(_dates,"dddd"),
VSTACK({"