Discussion The Lambda function and its reliance on the Excel Name Manager in Excel
https://techcommunity.microsoft.com/t5/excel/the-lambda-function-and-its-reliance-on-the-excel-name-manager/m-p/2279246#M96994
<P>I am using a gaming laptop with Windows 10 and Office365. </P><P> </P><P>I have spreadsheets with complex formulas. I have been trying to use the Lambda function to replace these formulas, but I am running into issues because of the Lambda function's reliance on the Excel Name Manager. I have a specific example of the problem:</P><P> </P><P>In my gradebook (I teach an online class), on the sheet where I use the Lambda function, the students' last names are in column 2, beginning in cell C2 and extending down several rows, depending on how many students are in the class. The name of my Lambda function is "Homework".</P><P> </P><P>I have a name, "LastName", defined, and the "Refers To" value is $C2. The problem is that I cannot depend on this Refers To value, as the Name Manager keeps changing it. The formula that uses this name is a formula that calculates a grade value for each student's homework for each week of the session. When I enter "=Homework(6)" in the cell for the homework of the students, with the "6" referring to the week (this value will be anything from 1 to 7 during a session), the function usually returns an incorrect value until I go into the Name Manager and fix the Refers To for "LastName".</P><P> </P><P>The Name Manager usually has changed the "Refers To" to $C$1; sometimes it's $C1048576. It is NEVER, when I'm first starting out to do grades for a given week, the reference I specified when I created the name ($C2).</P><P> </P><P>As far as I am concerned, this is a fatal flaw for the Lambda function. If I cannot depend on the name references I specified being stable, how can I depend on the Lambda function to return a correct result? Why must I always check the references to make sure Excel hasn't changed them?</P><P> </P><P>I understand that I could fix this problem by using an explicit cell reference in the Lambda formula instead of an Excel name. The only cell that must be named for a Lambda is the one used to pass a value to the Lambda. This, in my opinion, misses the point.</P><P> </P><P>What if I want to use Excel names for all of my variables in the formula, and what if one of those names has a Refers To value of $C2, i.e., the column is fixed but the row changes as the formula is calculated? </P><P> </P><P>I think Lambda's dependence on the Excel Name Manager is a significant weakness that compromises its usefulness. I have seen no disclaimers that warn a user that using Excel names in Lambda formulas may result in the Lambda returning an incorrect result for certain forms of names.</P><P> </P><P>George Rickerson</P>Tue, 20 Apr 2021 17:56:00 GMTGeorge_Rickerson2021-04-20T17:56:00ZThe Lambda function and its reliance on the Excel Name Manager
https://techcommunity.microsoft.com/t5/excel/the-lambda-function-and-its-reliance-on-the-excel-name-manager/m-p/2279246#M96994
<P>I am using a gaming laptop with Windows 10 and Office365. </P><P> </P><P>I have spreadsheets with complex formulas. I have been trying to use the Lambda function to replace these formulas, but I am running into issues because of the Lambda function's reliance on the Excel Name Manager. I have a specific example of the problem:</P><P> </P><P>In my gradebook (I teach an online class), on the sheet where I use the Lambda function, the students' last names are in column 2, beginning in cell C2 and extending down several rows, depending on how many students are in the class. The name of my Lambda function is "Homework".</P><P> </P><P>I have a name, "LastName", defined, and the "Refers To" value is $C2. The problem is that I cannot depend on this Refers To value, as the Name Manager keeps changing it. The formula that uses this name is a formula that calculates a grade value for each student's homework for each week of the session. When I enter "=Homework(6)" in the cell for the homework of the students, with the "6" referring to the week (this value will be anything from 1 to 7 during a session), the function usually returns an incorrect value until I go into the Name Manager and fix the Refers To for "LastName".</P><P> </P><P>The Name Manager usually has changed the "Refers To" to $C$1; sometimes it's $C1048576. It is NEVER, when I'm first starting out to do grades for a given week, the reference I specified when I created the name ($C2).</P><P> </P><P>As far as I am concerned, this is a fatal flaw for the Lambda function. If I cannot depend on the name references I specified being stable, how can I depend on the Lambda function to return a correct result? Why must I always check the references to make sure Excel hasn't changed them?</P><P> </P><P>I understand that I could fix this problem by using an explicit cell reference in the Lambda formula instead of an Excel name. The only cell that must be named for a Lambda is the one used to pass a value to the Lambda. This, in my opinion, misses the point.</P><P> </P><P>What if I want to use Excel names for all of my variables in the formula, and what if one of those names has a Refers To value of $C2, i.e., the column is fixed but the row changes as the formula is calculated? </P><P> </P><P>I think Lambda's dependence on the Excel Name Manager is a significant weakness that compromises its usefulness. I have seen no disclaimers that warn a user that using Excel names in Lambda formulas may result in the Lambda returning an incorrect result for certain forms of names.</P><P> </P><P>George Rickerson</P>Tue, 20 Apr 2021 17:56:00 GMThttps://techcommunity.microsoft.com/t5/excel/the-lambda-function-and-its-reliance-on-the-excel-name-manager/m-p/2279246#M96994George_Rickerson2021-04-20T17:56:00ZRe: The Lambda function and its reliance on the Excel Name Manager
https://techcommunity.microsoft.com/t5/excel/the-lambda-function-and-its-reliance-on-the-excel-name-manager/m-p/2279349#M97017
<P><LI-USER uid="1031698"></LI-USER> </P>
<P>George, names in Excel are connected, but these are different things. You may use LAMBDA only with local names without global names in name manager manager, if only to name lambda function.</P>
<P>Names with relative references are always works such way as you described, independently on lambdas. If you stay in row #3 and define the name as reference on $C2, in any cell in second row name will show $C1, if you stay in first row it shows <SPAN>$C1048576 since you are out of grid range and reference reverted on the last row of the grid.</SPAN></P>
<P>Lamdas are oriented to work with arrays. In your case that could be range $C$2:$C$50 or so named as lastName and within lambda you calculate where is data for week 6 depends on your data structure logic, and return desired value.</P>
<P>You don't need relative cell references working with arrays and lambdas.</P>Tue, 20 Apr 2021 19:51:34 GMThttps://techcommunity.microsoft.com/t5/excel/the-lambda-function-and-its-reliance-on-the-excel-name-manager/m-p/2279349#M97017Sergei Baklan2021-04-20T19:51:34Z