SOLVED

What's wrong in this simple LAMBDA function?

%3CLINGO-SUB%20id%3D%22lingo-sub-2026044%22%20slang%3D%22en-US%22%3EWhat's%20wrong%20in%20this%20simple%20LAMBDA%20function%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2026044%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20reading%20this%20article%20and%20trying%20out%20the%20new%20feature%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Flambda-function-bd212d27-1cd1-4321-a34a-ccbf254b8b67%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELAMBDA%20function%20-%20Office%20Support%20(microsoft.com)%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20decided%20to%20do%20something%20super%20simple%20like%20this%20but%20it%20throws%20and%20error%20message%20that's%20shown%20on%20the%20picture%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221.jpg%22%20style%3D%22width%3A%20702px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243671i792D50347C41BE73%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%221.jpg%22%20alt%3D%221.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20this%20one%20works%20just%20fine%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%222.jpg%22%20style%3D%22width%3A%20681px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243672i9E8C98A1546FDDBC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222.jpg%22%20alt%3D%222.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eas%20you%20can%20see%2C%20If%20i%20remove%20the%20numbers%20from%20my%20parameters%2C%20the%20error%20is%20gone%2C%20but%20I%20want%20to%20use%20numbers%20and%20letters%20in%20my%20parameters.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2026044%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2026208%22%20slang%3D%22en-US%22%3ERE%3A%20What's%20wrong%20in%20this%20simple%20LAMBDA%20function%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2026208%22%20slang%3D%22en-US%22%3EYou%20are%20lucky%20to%20have%20the%20LAMBDA%20function%20to%20test!%20I%20am%20still%20waiting%20-%20impatiently.%20As%20a%20first%20thought%20I%20would%20suggest%20that%20using%20cell%20references%20for%20names%20is%20asking%20for%20trouble.%20If%20you%20want%20brief%20names%20I%20would%20expect%20%3D%20LAMBDA(n%E2%82%81%2C%20n%E2%82%82%2C%20n%E2%82%81%2Bn%E2%82%82)(2%2C2)%20to%20work.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2026415%22%20slang%3D%22en-US%22%3ERe%3A%20What's%20wrong%20in%20this%20simple%20LAMBDA%20function%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2026415%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EThank%20you%2C%20I%20wasn't%20aware%20at%20all%20that%20the%20parameter%20name%20(variable%20name)%20I%20chose%20was%20actually%20referring%20to%20a%20very%20distant%20cell%20name%20in%20Excel%20sheet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eany%20tips%20on%20how%20to%20avoid%20choosing%20an%20Excel%20cell%20name%20when%20deciding%20to%20type%20a%20parameter%20name%3F%3C%2FP%3E%3CP%3Ebecause%20if%20the%20cells%20are%20infinite%2C%20they%20could%20potentially%20contain%20lots%20of%20words%20%2B%20numbers%20combinations.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20using%20Office%20365%20and%20joined%20Insider%20Beta%20channel%20by%20the%20way.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Honored Contributor

I was reading this article and trying out the new feature

LAMBDA function - Office Support (microsoft.com)

I decided to do something super simple like this but it throws and error message that's shown on the picture

 

1.jpg

 

But this one works just fine

 

2.jpg

 

as you can see, If i remove the numbers from my parameters, the error is gone, but I want to use numbers and letters in my parameters.

 

 

4 Replies
Best Response confirmed by HotCakeX (Honored Contributor)
Solution

You are lucky to have the LAMBDA function to test! I am still waiting - impatiently. As a first thought I would suggest that using cell references for names is asking for trouble. If you want brief names I would expect

= LAMBDA(n₁, n₂, n₁+n₂)(2,2)

to work.

Hi,

Thank you, I wasn't aware at all that the parameter name (variable name) I chose was actually referring to a very distant cell name in Excel sheet.

 

any tips on how to avoid choosing an Excel cell name when deciding to type a parameter name?

because if the cells are infinite, they could potentially contain lots of words + numbers combinations.

 

 

I'm using Office 365 and joined Insider Beta channel by the way.

@HotCakeX 

No profound advice I am afraid.  Just avoid names with three characters followed by up to 7 digits as well as R or C used by themselves.  It is particularly galling for me because my house style forbids the practice of direct cell referencing, if for no better reason that almost all the 17 billion possible cell names refer to unseen areas of the sheet that are not even part of my model and would therefore represent errors. 

 

I have found the Unicode characters provided by Insert>Symbol to be a rich source of possible names.  For example, adding modifiers or subscripts can make the name illegal as a cell reference and thus, legal as a name.  For example

∞, ltr∕hr, x₁, π, ϑ, R̅

all work as names.  The downside is that they are inconvenient to generate with the keyboard;  F3 or IntelliSense are still options though.

Thanks, that was very helpful!