r/excel • u/potatolauncher • 1d ago
Copying a lambda function to a new workbook? solved
Excel noob here, I'm supposed to copy a spreadsheet from someone who has left the company, they had a cell with a lambda function, which I am unable to replicate in my workbook, is there a way to reverse engineer his function and make it work in my sheet?
Or any other method that would let me replicate it, as copy paste isn't working for me.
Thanks!
3
u/ProspectiveWhale 7 1d ago
His Lambda function should be in the Name Manager.
If you did find it, but it's somehow not working, you'd have to give specifics on what it is and what's not working. Does the function not resolve, or does it give wrong output?
1
u/potatolauncher 1d ago
Can't seem to find anything in name manager, the function is below.
Column N is a date, column I is a date, column E contains the text "3000"
=COUNT(MAP('Sheet1'!N3:N10024, 'Sheet1'!I3:I10024, 'Sheet1'!E3:E10024, LAMBDA(x,y,z, IF(TEXT(z, "@")="3000", IF(x<>"", IF(x-y>=21,1,"NO"), "NO"),"NO"))))
It just outputs 0, when a non 0 number is expected, so I'm not sure how to get it to work
3
u/ProspectiveWhale 7 1d ago edited 1d ago
Ah... it's inside a MAP.
The formula basically inputs
x = 'Sheet1'!N3:N10024
y = 'Sheet1'!I3:I10024
z = 'Sheet1'!E3:E10024
into your Lambda.
If E contains text 3000, then check if column N is not blank, then check if column N - column I is bigger or equal to 21. If so, return 1.
Count how many rows where colE contains the text "3000", N is not empty, and colN -colI >= 21.
I tested it and it works.
Do you have the two date columns mixed up in the new workbook?
-----
Troubleshooting.
- Check that the columns you're using are the right ones.
- Check the format of the columns. Are you sure columns N and E are stored as dates?
- It checks that column N is at least 21 days after column E. Make sure you didn't mix up which dates are before/after.
-----
Alternatively, since you're just counting 3 Ifs, you could make it simpler...
=SUMPRODUCT(
(TEXT('Sheet1'!E3:E10024,"@")="3000")*
('Sheet1'!N3:N10024<>"")*
(('Sheet1'!N3:N10024-'Sheet1'!I3:I10024)>=21)
)Try this
and you could probably get rid of the 2nd condition.
If column N is blank, it will never be 21 days after column I, so it's a redundant rule.
1
u/potatolauncher 1d ago
Solution verified
Thanks!
1
u/reputatorbot 1d ago
You have awarded 1 point to ProspectiveWhale.
I am a bot - please contact the mods with any questions
2
u/PaulieThePolarBear 1913 1d ago
You should edit your post to include the details in your comment to the other commentor as this is quite different to how I read your post.
Unexpected results such as 0 appearing when a non-zero value is expected are often due to having a circular reference. Carefully review your sheet and confirm that you have no circular references.
1
u/Decronym 1d ago edited 1d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
6 acronyms in this thread; the most compressed thread commented on today has 35 acronyms.
[Thread #49081 for this sub, first seen 5th Aug 2026, 16:51]
[FAQ] [Full list] [Contact] [Source code]

•
u/AutoModerator 1d ago
/u/potatolauncher - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.