'Excel Nested Lambda
I've written the outside of a function as an Excel Lambda function.
LAMBDA(Years, TextFmt, EndOfMonth, ByRows,
LET(
MonthNbrs, IF(ByRows, SEQUENCE(1, 12, 1, 1), SEQUENCE(12, 1, 1, 1)),
Dates, MAP(
Years,
LAMBDA(Year, MAP(MonthNbrs, LAMBDA(Month, DATE(Year, Month, 1))))
),
Dates
)
)
I'm trying to enumerate years by months.
Dates as a return keeps giving me a Calc error.
Solution 1:[1]
Jos Wooley nailed it for people who have the TOCOL function.
=LAMBDA(Years,TextFmt,EndOfMonth,ByRows,LET(Dates,TOCOL(EOMONTH(DATE(Years,SEQUENCE(12),1),IF(EndOfMonth,0,-1))+1-EndOfMonth),IF(ByRows,Dates,TRANSPOSE(Dates))))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ZygD |
