Microsoft announces a new feature that will revolutionize how you build formulas in Excel
2 min. read
Published on
Read our disclosure page to find out how can you help MSPoweruser sustain the editorial team Read more
Microsoft today announced a new feature that will revolutionize how you build formulas in Excel. Excel formulas are extremely popular, but you can’t use the formula language to define your own re-usable functions. The new LAMBDA feature will allow you to define your own custom functions using Excel’s formula language. You can also call one function from another.
Reusable Custom Functions
With LAMBDA, you can take any formula you’ve built in Excel and wrap it up in a LAMBDA function and give it a name (like “MYFUNCTION”). Then anywhere in your sheet, you can refer to MYFUNCTION, re-using that custom function throughout your sheet. I’ll show a couple examples below.
Recursion
Reusable functions is reason enough to start taking advantage of LAMBDA, but there’s one more thing… you can do recursion. If you create a LAMBDA called MYFUNCTION for example, you can call MYFUNCTION within the definition of MYFUNCTION. This is something that before, was only possible in Excel through script (like VBA/JavaScript). I’ll also show an example below of how you can leverage this to build things that were not possible before without writing script.
Syntax:
=LAMBDA([parameter1, parameter2, …,] calculation)
Argument | Description |
---|---|
parameter | A value that you want to pass to the function, such as a cell reference, string or number. You can enter up to 253 parameters. This argument is optional. |
calculation |
The formula you want to execute and return as the result of the function. It must be the last argument and it must return a result. This argument is required. |
The new lambda function is available to Office Insiders on Microsoft Windows and Mac builds of Excel.
Source: Microsoft
User forum
0 messages