Questions tagged [excel-lambda]

Used for questions related to custom lambda functions in Excel.

Custom functions in Excel used to be written using VBA or JavaScript. Since the introduction of LAMBDA it's possible to define custom functions using Excel’s formula language. They don't require enabling macros.

Syntax:
=LAMBDA([parameter1, parameter2, …,] calculation)
parameter. A value to pass to the function, e.g. a cell reference, string or number. Accepts up to 253 parameters. This argument is optional.
calculation. The formula to execute and return as the result. It must be the last argument and it must return a result. This argument is required.

If used as an example in a cell, it can be put like this:
=LAMBDA(x,x^2)(5)
5 is the number which is passed to the function. It takes the place of x, in the calculation x^2. So, the actual calculation in this case is 5^2. It gives the result of 25.

To be able to reuse lambda functions they must be put into Excel's Name Manager. Using the previous example, =LAMBDA(x,x^2) should be put in the Refers to: section and some name should be provided in the Name: section (e.g., SQUARE). Then this function will become available in the workbook by its name =SQUARE().

58 questions
1
vote
1 answer

Including additional table columns into Let function constructed table with the ability to sort based on column value Excel

I have the following function giving a list of available staff after a specified date set in T2 =LET(uniqueEmployees,UNIQUE(AllStaffProjectAllocationTbl[Employee]),…
1
vote
1 answer

Loop through an array in a single worksheet cell

I am trying to calculate an amount based on a formula that has a different number of arguments for each calculation. And, each formula is expressed as a string that is based on the column names at the top of the sheet (e.g. item1). Each argument…
1
vote
2 answers

Advanced problem of finding minimum sum of N consecutive numbers with a twist

Yesterday I have asked a similar question, yet this one has a rather advanced addition: Let us say we have a dataset that consists of Hotel and Airline prices (From 1st to 31st of Jan). I would like to know what would be the "cheapest" trip of N…
1
vote
1 answer

Create an array from hard-coded values for use in a LAMBDA function

I have recently created a LAMBDA function for recursive substitutions of substrings which works when using a range: LAMBDA named ReplaceArray =LAMBDA(str, list, sub, IF(ROWS(list)=1, SUBSTITUTE(str,list,sub),…
Tragamor
  • 3,594
  • 3
  • 15
  • 32
1
vote
1 answer

Conditional branches of a function raise false circle reference errors

I have a big function with lots of branches of IFS; each branch uses different references of the worksheet: MYFUN = LAMBDA(i, IFS( i = 1, // a formula uses Row 1 for instance, i = 2, // a formula uses Row 2 for instance, …
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
1
vote
0 answers

Recursive Lambda Confusion

I'm trying to build a Schedule Generator using recursive LABMDA based on RANDBETWEEN function. Basically, what it needs to do: Generate a random date using RANDBETWEEN based on 2 other cells which include start and end of the month. Lookup A2#'s…
BBK
  • 11
  • 1
1
vote
0 answers

Excel Lambda function: iterating For Loop

So, I am working on another issue and need to check a 12 x 6 excel range for errors. If there is an error, I want it to build a new 12 x 6 range within the function and then check that for errors. I am at the very beginning and very new to Lambda…
SmithL
  • 23
  • 8
1
vote
2 answers

Tax Brackets and Volume Discounts using Excel

It's the end of January and that magical feeling of "tax time" is starting up around the world. A common problem is to calculate tax owed based on a set of tax brackets and rates. This is also similar to calculating total order costs based on a…
mark fitzpatrick
  • 3,162
  • 2
  • 11
  • 23
1
vote
1 answer

How do you create a variable length array inside an Excel formula?

I am writing a SPLIT function using the new lambda function to recursively pull items out of a text string, based on a delimiter. The problem is that I need to keep a variable length list in memory of these items as I find them, ie a list that grows…
dbb
  • 2,827
  • 18
  • 16
1
vote
2 answers

Using an Excel Spill Range as data Source for a Recursive Lambda Function

I wrote an Excel LAMBDA function for extracting numbers from a string. This is the…
draustine
  • 35
  • 5
0
votes
1 answer

Microsoft documents LAMBDA attached to a defined name. Is this possible to create with Openpyxl?

I have a complicated workbook that I am generating with Openpyxl. I've decided to revise the formulas to use Excel's so-called future functions and array functions. Some of the formulas are getting pretty long and I was able to use the new LAMBDA…
Cronical
  • 1
  • 2
0
votes
1 answer

What prevents a lambda function from evaluating on an array?

I thought that a lambda function defined for scalar input values would automatically iterate through an array when faced with an array input, but it seems that it's not universally true. I want to understand why, because I'm not happy with the…
vladi
  • 1
  • 1
0
votes
0 answers

Excel - using MAKEARRAY and LAMBDA to reduce repetition of CUBEVALUE/CUBEMEMBER formula

I want to make use of the MAKEARRAY and LAMBDA functions in Excel to help avoid repeating a number of CUBEVALUE/CUBEMEMBER formulas. This was inspired by Chris Webb's blogpost…
J Doe
  • 79
  • 6
0
votes
2 answers

Repeat a range a number of times

I have a simple problem, but I am not quite able to figure out the answer Given a range (in blue), and a number of times to be repeated (in orange), I need to create 2 spill arrays in vertical: the first one repeats the range the desired number of…
vsoler
  • 1,027
  • 2
  • 8
  • 17
0
votes
1 answer

How to use Lambda in Excel to return array of results for an array

I am becoming more and more familiar with Excel's new array functionality and absolutely love the direction it is all headed. I've been trying to find a way to have a single formula which will spill an array of multiple columns, each which…
Andy L
  • 93
  • 6