LAMBDA.EVALUATE

=LAMBDA.EVALUATE(formulaText)

formulaText
a valid formula string in Excel (some limitations apply)

LAMBDA.EVALUATE is equivalent to the old Excel 4.0 macro EVALUATE with some limitations.

tboulden

Board Regular
Joined
Jan 14, 2021
Messages
73
Office Version
  1. 365
Platform
  1. Windows
The old Excel 4.0 macro EVALUATE has been available via the Name Manager for some time, but was hard to use. Now with LAMBDA we can name a function that uses EVALUATE and use that function in a sheet.

Some limitations:
  • can only be instantiated from Name Manager and workbook must be xlsm
  • string to evaluate must be fewer than 256 chars.
  • if the formula would have required array (Ctrl+Shift+Enter) entry before, you may need to coerce/dereference the formula
  • LAMBDA.EVALUATE can't evaluate another reference to LAMBDA.EVALUATE
  • probably others I haven't quite come across or figured out just yet
I've named my implementation with "λ_EVAL" for brevity, but figure LAMBDA.EVALUATE makes more sense as an intro. I've used this to help me debug LET/LAMBDA functions as I've been wrapping my head around how the functions work. It loses some utility as formulas get longer, but I use REPLACESTRINGS to shorten formula length if needed while building/testing.

Link to original on Microsoft Excel discussion board: Legacy EVALUATE in LAMBDA: Build/Test LAMBDAs from Sheet

LAMBDA_Testing.xlsm
ABCDEF
1Can only be instantiated from Name Manager, not from cell/sheet, and workbook must be xlsm
2=LAMBDA(x,EVALUATE(x))
3
4LengthEntry TextFormula TextlambdaEVALFormula Text
58FACT(10)3628800=λ_EVAL(C5)
6
718LET(a,20,b,30,a+b)50=λ_EVAL(C7)
8
9LET(
10a,20,
11b,30,
12a+b
13)
1418LET(a,20,b,30,a+b)=TEXTJOIN("",TRUE,C9:C13)50=λ_EVAL(C14)
15
16LAMBDA(
17x,
18x+1
19)
2013LAMBDA(x,x+1)=TEXTJOIN("",TRUE,C16:C19)8=λ_EVAL(C20&"(7)")
Examples and Limitations
Cell Formulas
RangeFormula
A5,A20,A14,A7A5=LEN(C5)
E5,E14,E7E5=λ_EVAL(C5)
F5,D20,F20,D14,F14,F7F5=FORMULATEXT(E5)
C14C14=TEXTJOIN("",TRUE,C9:C13)
C20C20=TEXTJOIN("",TRUE,C16:C19)
E20E20=λ_EVAL(C20&"(7)")
 
Upvote 0
Note I've tested several other old Excel 4.0 XLM macro functions and got the following working using LAMBDA: FILES, GET.WORKBOOK, NAMES, GET.NAME. I'm sure there are many others that work as long as they are informational and don't try to manipulate other objects. I'm not well-versed enough to know how much utility these provide, so don't know that they need there own thread.
 

Forum statistics

Threads
1,224,829
Messages
6,181,224
Members
453,025
Latest member
Hannah_Pham93

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top