Forum Discussion

ColinJHarrison's avatar
ColinJHarrison
Brass Contributor
Nov 24, 2022

Passing a Table as a variable (in a LAMBDA() function)

Hi,   Why can't I do this (in Excel 356)? I have a table called Table   I'm trying to build a LAMBDA() function that will contain something like the following (this is the test syntax...):   =L...
  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Nov 25, 2022

    ColinJHarrison I think the point you are missing is that Table1 may refer to the table itself as a dynamic array and to the name of the table which is no more than a text. The LAMBDA needs to refer to the table name.

     

    Remove the quotes in A2 and change the formula to this:

    =LAMBDA(Tn,INDIRECT(Tn&"[#Headers]"))(A2)

     

    Similar for the named LAMBDA function. You want to feed it the text that is in A2, so

    =TPX(A2) will work.

     

    See attached.

Resources