As others have mentioned, this is essentially a user-defined function. I generally shy away from these as it will make it difficult to share spreadsheets with others as they may not even know what lambdas are. Auditing lambdas will be a nightmare, as will tracing dependencies.
Lambda: Turn Excel formulas into custom functions
81–90 of 140 posts
Re: Lambda: Turn Excel formulas into custom functions
#82Earlier quoted context omitted.
=LAMBDA(...) does return an anonymous function - and then you use the Names Manager to name it. It is a bit weird and confusing because you currently can’t really use the anonymous functions without naming them, but maybe they’re going to relax that restriction eventually?
The article also says this is valid within the grid: One last thing to note, is that you can call a lambda without naming it. If we hadn’t named the previous formula, and just authored it in the grid, we could call it like this: =LAMBDA(x, x+122)(1) Edit: typo
Re: Lambda: Turn Excel formulas into custom functions
#83Microsoft: Hey, we have this new feature. It's called Macros. You can execute any code you like and use it as functions in your spreadsheets. Users: Great! Let's start using it everywhere! Users: Hey! Our spreadsheets have become very slow and hackers break into our systems by executing arbitrary code in our spreadsheets Microsoft: OK! From now on you will have to save workbooks that can execute arbitrary code in a d…
Allow me to reminisce.. in 2012 I created a JavaScript VM extension that executes custom functions inside native Excel. The extension also had a corresponding web-based front-end for creating apps that read/write directly to Excel. This was my baby, but investors (ie, YC) didn't think it was disruptive enough. Now I see these apps (ie, AirTable) pop up every month. Should I open source it?
Re: Lambda: Turn Excel formulas into custom functions
#84Well, except for the Name Manager part in their implementation, which seems to be a total disaster. I really hope this is a first version and they are going to keep improving it as they say. One should really define the functions in the cells and be able to reference them like =A1(2). The last thing a beautiful functional environment needs is globals.
Super curious what the future of Excel holds.
Re: Lambda: Turn Excel formulas into custom functions
#85Earlier quoted context omitted.
Yes, but there is no mention of debugging. In the hands of Excel cowboys, this can become another foot gun.
A number of bugs will be solved by moving to it (a copied function is typo’d in one cell, etc) and you can test it pretty easily in a cell. Excel is basically a REPL with cells.
Re: Lambda: Turn Excel formulas into custom functions
#86Re: Lambda: Turn Excel formulas into custom functions
#87Earlier quoted context omitted.
The problem with “macros” is that they can be arbitrary VBA code that can invoke OS functions and foreign applications. Lambdas can only invoke Excel functions that you can invoke anyway from any Excel cell. Lambdas merely add an abstraction mechanism, they otherwise don’t provide access to new functionality.
This is what they said: new capability that will revolutionize how you build formulas in Excel Which isn't really true. I can call macros using the =function(x) capability like forever.
To be honest, I think this is awesome and has been sorely missed.
Re: Lambda: Turn Excel formulas into custom functions
#88This seems like it lowers the learning curve for, at the very least, adding DRY principals to more every day use cases.
I consider myself fairly comfortable in Excel. The number of times I've been burned in my own (or more likely shared) spreadsheet by things like copying down a formula that got modified in one instance but not all and related issues is staggering.
Being able to have some cells where core logic lives makes it easier for less technical people to understand what's going on, and makes formulae a lot more reusable.
Re: Lambda: Turn Excel formulas into custom functions
#89Earlier quoted context omitted.
The problem with “macros” is that they can be arbitrary VBA code that can invoke OS functions and foreign applications. Lambdas can only invoke Excel functions that you can invoke anyway from any Excel cell. Lambdas merely add an abstraction mechanism, they otherwise don’t provide access to new functionality.
This is what they said: new capability that will revolutionize how you build formulas in Excel Which isn't really true. I can call macros using the =function(x) capability like forever.
If you just had custom functions, you can trace them back pretty quickly and end up with an understanding. Teams will also probably create ‘known’ custom functions for their use case, like converting account Chart of Account codes to finance COA codes etc.
Re: Lambda: Turn Excel formulas into custom functions
#90This is a game-changer level feature. I have been dreaming of this and more other power features for a long while. Well, except for the Name Manager part in their implementation, which seems to be a total disaster. I really hope this is a first version and they are going to keep improving it as they say. One should really define the functions in the cells and be able to reference them like =A1(2). The last thing a be…
Name Manager though... Would be really nice if they could come up with some idioms for writing these functions in a multi-line format, with indentation, and give a slightly nicer editor. I realize that might be a bit tricky without changing the language syntax, but after the 2nd nested if-statement I find that I really struggle to follow someone's single-line Excel logic...