Genuine question, how and why would one use LAMDA Formulas?
Let vs Lambda - Pros and Cons
Help to get started with LET and LAMBDA
What LAMBDA function have you created that you’re most proud of?
First Monday of the Month
You can write complex Date logic to figure that out. But who wants to write the same formulas every time. This is the job for LAMBDA.
Define FirstMonday as,
=LAMBDA(anydate,
LET(som, DATE(YEAR(anydate),MONTH(anydate),1), CHOOSE(WEEKDAY(som),1,0,6,5,4,3,2)+som))
And to get the first Monday of any month, you can use =FIRSTMONDAY(any date)
For example, =FIRSTMONDAY(“1-jan-2022”) will be 3-Jan-2022 (which is the first monday).
Top N
Let’s say you have a list of values and just want to get the “topn” values in descending order. We can set up a LAMBDA to do that magic.
Define TOPN name as
=LAMBDA(values, n, LARGE(values, SEQUENCE(n)))
We can call this LAMBDA like:
=TOPN(a1:a10, 3) to see top 3 values in the range A1:A10.
Videos
I've been playing around with lambdas the last couple days and have been able to make some neat functions combining it with LET, HSTACK, and VSTACK along with other various functions to output spilled ranges of values with labels for each row of the range and then I set up a VBA macro in the personal macro workbook to add my lambda functions to whatever workbook I want to add them to.
Wondering what sorts of other neat functions others have come up with for lambdas?
I am decent at excel, can grab data and manipulate it in ways my brain views as the right option. But what is LAMDA? I keep seeing pop up on this Reddit like a godsend and am wondering what the applications are for it and how or if I could use it in my work life?
Can someone provide an example? I’ve never used it before….. baby steps.