Having trouble with creating a LAMBDA function. I create a LET formula and make a =LAMBDA() function out of it. But I would also like a certain cell reference as part of the tool. Same position/size for use in every sheet, not supposed to be touched by the user (kind of an 'ActiveSheet.Range("$A$1:$A$200"') in VBA code). But when I save the LET formula as a LAMBDA function it automatically converts that "hidden" reference into a 'OnlyThatSheetName!$A$1'-type of reference, making the function useless in other sheets.
The formula for it:
=LET(
somr,Conv!C1:C890, <--(named reference open for user in LAMBDA)
htjomr,HtjAlen!A1:A2500, <--(named reference open for user in LAMBDA)
brukomr,C1:C200, <--(the one that turns into SpecifikSheetName!C1:C200 when saved in LAMBDA)
resomr,OFFSET(somr,,1),
htjres,OFFSET(htjomr,,1),
rownum,COUNTA(brukomr),
seq,SEQUENCE(rownum-1,,2),
ind,INDEX(brukomr,seq),
person,XLOOKUP(ind,somr,resomr,"N/A"),
CHOOSE({1/2},person,XLOOKUP(RIGHT(person,11)&" Sum",SUBSTITUTE(htjomr,"+","-"),htjres,""
)))
It's supposed to be used in a designated column in the table, so if there is some sort of "offset from formula cell" solution possible to reach info from another column in the same sheet, that will also work. Anyone have a trick for this in the backpocket... or anyone want to tell me that it's not possible (so I can put it aside)?
(And before suggestions about using things like table objects and named columns etc... the design of the sheet isn't mine to mess with, so that's not possible.)
Regards,
/Nick
The formula for it:
=LET(
somr,Conv!C1:C890, <--(named reference open for user in LAMBDA)
htjomr,HtjAlen!A1:A2500, <--(named reference open for user in LAMBDA)
brukomr,C1:C200, <--(the one that turns into SpecifikSheetName!C1:C200 when saved in LAMBDA)
resomr,OFFSET(somr,,1),
htjres,OFFSET(htjomr,,1),
rownum,COUNTA(brukomr),
seq,SEQUENCE(rownum-1,,2),
ind,INDEX(brukomr,seq),
person,XLOOKUP(ind,somr,resomr,"N/A"),
CHOOSE({1/2},person,XLOOKUP(RIGHT(person,11)&" Sum",SUBSTITUTE(htjomr,"+","-"),htjres,""
)))
It's supposed to be used in a designated column in the table, so if there is some sort of "offset from formula cell" solution possible to reach info from another column in the same sheet, that will also work. Anyone have a trick for this in the backpocket... or anyone want to tell me that it's not possible (so I can put it aside)?
(And before suggestions about using things like table objects and named columns etc... the design of the sheet isn't mine to mess with, so that's not possible.)
Regards,
/Nick