In these days I'm struggling with a LAMBDA I found online that doesn't work, but for an incomprehensible reason.This is the function we could call CALENDAR:
=LAMBDA(Year,Month,Day,LET(INPUT,DATE(Year,Month,Day), A, EXPAND(TEXT(SEQUENCE(7), "ddd"),6+WEEKDAY(INPUT,1),""), B, DAY(SEQUENCE(EOMONTH(INPUT,0)-INPUT+1,,INPUT)), C, EXPAND(UPPER(TEXT(INPUT, "MMM")),7,,""), D, WRAPROWS(VSTACK(C,A,B),7,""),D))
The strange thing is that breaking it down with a simple LET .... works, but as soon as I assemble it as LAMBDA it goes into error.
Can you figure out why?
=LAMBDA(Year,Month,Day,LET(INPUT,DATE(Year,Month,Day), A, EXPAND(TEXT(SEQUENCE(7), "ddd"),6+WEEKDAY(INPUT,1),""), B, DAY(SEQUENCE(EOMONTH(INPUT,0)-INPUT+1,,INPUT)), C, EXPAND(UPPER(TEXT(INPUT, "MMM")),7,,""), D, WRAPROWS(VSTACK(C,A,B),7,""),D))
The strange thing is that breaking it down with a simple LET .... works, but as soon as I assemble it as LAMBDA it goes into error.
Can you figure out why?