Unable to find error!

Salvatore

New Member
Joined
Mar 9, 2024
Messages
8
Office Version
  1. 365
Platform
  1. Windows
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?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi & welcome to MrExcel.
The problem is in section "A" as the expand function is wrong.
It should be
Excel Formula:
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))
 
Upvote 0
I have tested your formula but the lambda is in error again.
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))

My version is the following:

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))

and the difference is a "comma" in A ... but lambda goes in error
 
Upvote 0
What error do you get?

Can you post some sample data that shows the problem.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
simply the usual message, "The formula contains an error."

I cannot give further details as I use the Italian version of Excel and have translated the function I displayed with the functions in Italian ... for verification I also used the AFE add-in using it for conversion.

The only caution is the parameter "ddd" which in Italian is "ggg".

However, the formula goes into error ... even using AFE
= LAMBDA(Year; Month; Day;
LET(
INPUT; DATA(Year; Month; Day);
A; ESPANDI(TESTO(SEQUENZA(7); "ggg"); 6 + GIORNO.SETTIMANA(INPUT; 1); ; "");
B; GIORNO(SEQUENZA(FINE.MESE(INPUT; 0) - INPUT + 1; ; INPUT));
C; ESPANDI(MAIUSC(TESTO(INPUT; "MMM")); 7; ; "");
D; A.CAPO.RIGA(STACK.VERT(C; A; B); 7; "");
D
)
);;

As I wrote, if I use a simple LET instead ...the formula works correctly
 
Upvote 0
With the change I mentioned before the formula works fine for me, so I can only assume that there is a problem with the translation to Italian.
 
Upvote 0
In the AFE add in is to make and END to the lambda modules ... do you kown?
I think to solve the problem ... that you may send me you excel test file with you version
When I open the ... automatically the formulas are converted to Italian.
That way I can check the error.
I don't know how else to try
Many thank fort you cooperation
 
Upvote 0
Excuse me for BAD english

In the AFE add this is to make the END of the lambda in modules ... do you know AFE?
I think to solve the problem ... that you may send me your excel test file with your version
When I open the excel file ... automatically the formula is converted to Italian version
So, I can check the error.
I don't know how else to try
Many thank for your cooperation
 
Upvote 0

Forum statistics

Threads
1,215,920
Messages
6,127,709
Members
449,399
Latest member
VEVE4014

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top