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
0
votes
1 answer

Adding Tolerances to Excel LAMBDA functions

I created a LAMBDA function called LOANAMT to calculate loan amounts recursively for a situation in which you need to borrow to fund the loan payment (yes, I know this can be solved algebraically - I'm trying to learn about LAMBDA). I incorporated a…
0
votes
1 answer

Calculate production capacity per product/day up to goal

I have the following data. Available resources data per day: A B C D E F G H I J K L M N 2 resources day 3 1 2 3 4 5 6 7 8 9 10 11 12 4 empl.1 8 8 4 2 2 4 4 8 8 5 empl.2 8 4 4 8 4 8 6 empl.3 And…
P.b
  • 8,293
  • 2
  • 10
  • 25
0
votes
0 answers

Excel not recognizing this LET and LAMBDA combo formula as a formula (receiving 'there's a problem with this formula' error)

Excel is not recognizing this LAMBDA/LET combo formula as a formula (receiving the 'there's a problem with this formula' error). I thought it might have been something to do with the variable names I was using, but I've changed them and that…
Gavin
  • 21
  • 3
0
votes
1 answer

Formula to automatically subtract and multiply two rows over a variable number of columns

I have the following sum in G4 =SUM((G2:G3)*$D$2) and in G6 I have =SUM(G4-G5), I then drag copy them for the duration denoted in C1. I'd like to change this so I have a single formula in H4 and H6 that will expand based on the value in C1. I have…
0
votes
1 answer

Limit the number of results when using Excel array functions

I am trying to use the SortBy function to return the top 3 results from a table that I have. If I put the function somewhere else in the sheet, I can just reference the first three cells, and that works fine. But I would like to do this with just…
DChi Shaggy
  • 22
  • 2
  • 5
0
votes
0 answers

Excel Lambda function produces a VALUE! error

I am using Excel version 2205 (Build 15225.20356) I expect that each of these functions produces the identical result $A$1 // no lambda or let =ADDRESS(ROW(A1),COLUMN(A1)) // lambda alone =LAMBDA(cell, ADDRESS(ROW(cell), COLUMN(cell)))(A1) // let…
PaulH
  • 7,759
  • 8
  • 66
  • 143
0
votes
0 answers

Why is this returning a #VALUE! error in Excel when I am using a simple LAMBDA function?

I have attached a pic of what I am trying to do. The goal is to get LAMBDA to subtract the previous cell and then average that. (AVERAGE RATE OF CHANGE)
0
votes
1 answer

Excel Nested Lambda

I've written the outside of a function as an Excel Lambda function. LAMBDA(Years, TextFmt, EndOfMonth, ByRows, LET( MonthNbrs, IF(ByRows, SEQUENCE(1, 12, 1, 1), SEQUENCE(12, 1, 1, 1)), Dates, MAP( Years, …
0
votes
1 answer

How can I merge these two formulas?

I'm trying to merge these two formulas so that it only works out the streak if the cell has a number (each cell has a formula in it but is blank) Formula 1 =MAX(SCAN(0,B1:B,LAMBDA(a,b,(a+(b<>0))*(b<>0)))) Formula 2 =IF(ISNUMBER(B1:B).....Do a…
KingLouie
  • 399
  • 1
  • 5
  • 13
0
votes
0 answers

Getting an incorrect result on a very simple Excel Lambda() function

Maybe I am missing something but I am getting an incorrect result on two excel Lambda functions in a simple test. One is named xytest(): =LAMBDA(x,y, IF(x > y, addy(x,y), "x=" & x & " < y=" & y) ) the other is addy(): =LAMBDA(x,y, …
SmithL
  • 23
  • 8
0
votes
1 answer

Can "Match Mode" functionality be created within a LAMBDA function in Excel?

I'm just starting to play around with LAMBDA, and was wondering if it was possible to replicate the mode selection that a few formulas have. For instance when using XLOOKUP: "Match Mode" example within XLOOKUP Can you create these option drop downs…
DKoontz
  • 177
  • 16
0
votes
0 answers

Why does my Excel formula return "cell contains a lambda error"?

I'm trying to follow the example for lambda in this post, I tried to type the Name HEAD in the A1 and the formula =LAMBDA(str,IF(str="","error: HEAD of empty string", LEFT(str,1))) in B1, as per the following GIF. I get a #CALC! error. There does…
Terry
  • 785
  • 1
  • 8
  • 20
-1
votes
1 answer

Create an array of the dates of the last X times something happened, including duplicates

I'm a very advanced Excel user and have used dynamic arrays and complex lambdas to solve some pretty tough problems, but this one has me stumped. I have a column (or array) of invoice dates, that are non-unique. I have a corresponding column of…
Max R
  • 798
  • 2
  • 7
1 2 3
4