Joseph, I noticed in your new Budget Status sheet, you use the Lambda Function. I have been trying to figure out the use case for this new function, but always go back to an array functions as I just don’t see the point.
Can you offer your smarts on how to use it, and why you chose it.
It’s very new to me, have only been aware of it for a few weeks. My main reason for using it is that it also works in Excel, and I’ve been trying to keep parity on my templates between the platforms. Beyond that, I like the combination of MAP and LAMBDA, which allows you to define a bunch of ranges, and then just use terms in the formula in place of those ranges. That helped me convert Budget Plan from copied formulas to arrays, and made them much easier to read. Still learning how to best use it, but so far seems very powerful!
I haven’t tried using it yet, @richl, but, when I restarted making Excel template, I was impressed with the LET() function… which seems like the inspiration for Sheet’s LAMBDA().
How I imagine using LAMBDA() is to address the performance issues associated with needing to make the same large non-performant queries multiple times in the same formula. In pseudo code, the problem it solves looks something like this:
Do you ever run into this problem in your formulas?
Without LAMBDA() this structure always felt incredibly inefficient to me… but maybe Sheets is smart enough to cache results (e.g. VLOOKUP(GIANT_ARRAY_A,...)) and a change to LAMBDA() is not necessary.
Would love to keep this thread rolling in case someone comes up with better answers.
While checking if Sheets supports LET (It doesn’t) I found this option related to LAMBDA and another new function, SCAN. In my Account Register template, I use the following formula to calculate the running balance:
Thanks for this, this is really helpful. I just tried the SCAN and Arrayformula on my transaction tracker, and the SCAN is much faster and also much easier to use.
-edit- I was playing around more and theMAP function in conjuction with LAMBDA should be very useful to lots of people.
Great thread, everyone. Hadn’t seen these new functions. I love how you are already putting them to use.
I see how LAMBDA() and SCAN() are new and powerful but I don’t quite understand how MAP() unlocks features previously not possible with ARRAYFORMULA().
So far I’m mostly using it to make formulas easier to read. Seeing ‘amount’ instead of ‘INDIRECT($CA$12)’ makes formulas much easier to understand. I also realized when setting up a LAMBDA, you aren’t limited to just putting a range, you can have a formula that produces a range, which does what @randy was mentioning about not having to repeat VLOOKUP(GIANT_ARRAY_A,…).
I found it to run faster than ARRAYFORMULA, although with how Sheets loads, I don’t know if it’s accurate, but as was pointed out, it’s also easier to read and edit.
Wow, a lot of power there! She does a good job of explaining the process, I’ll have to check out some of her other videos. The more I learn the build process the less I’ll have to rely on Google to find similar existing code to copy!