How to solve "Function LAMBDA should be followed by a call containing the actual values"?

Viewed 44

I didn't understand the LAMBDA function documentation example in Google help. Can you show me the simplest example for beginners?

The problem

I used this formula

=LAMBDA(x, SUM(x+2+x+5))

I get this error:

Function LAMBDA should be followed by a call containing the actual values.

How do I solve this?

enter image description here

1 Answers

Using LAMBDA avoids repititions by putting a range in LAMBDA call like this
LAMBDA([name, …], formula_expression)(range) and subtitite the range in the rest of the formula_expression with a name, in this case x or multiple names [name, ...].

Imagin having a range repeated 5 or more times, and that range is a long formula output, see this example

Using one name : x

The Old way

=SUM(B2+2+B2+5)

The new way using lambda

=LAMBDA(x, SUM(x+2+x+5))(B2)

enter image description here

Using multiple names: x,y

The Old way

=SUM(B2+2+B2+5)-B3*B3

The new way using lambda

=LAMBDA(x,y, SUM(x+2+x+5)-y*y)(B2,B3)

enter image description here

Common errors

You may encounter this error.

Error Function LAMBDA should be followed by a call containing the actual values.

you probably wrote it like this
LAMBDA([name, …], formula_expression)

It should be like this
=LAMBDA([name, …], formula_expression)(range1,...)
=LAMBDA(x,y, SUM(x+2+x+5)-y*y )(B2 ,B3 )

Related