Avatar of Anthony Mellor
Anthony MellorFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Rewrite this as a NON Lambda formula? or just simplify, to solve file crashing 8192 error.

Note for speed readers: all these formulas work. This is about simplification.

This Lambda APPEARS to be causing an 8192 error and/or crashing my file, so I write to ask for suggestions how to rewrite it is in non Lambda form, unless anyone can see a reason why this Lambda can be causing this problem.

and the formula is:

=LAMBDA(INVNO,LEDGER,NL,PAYEE,LET(many,ManyPaid(NL,RAs[[#All],[LOOKUP]]),IF(many,INDEX(RAs[[#All],[CrossRefs]],many,0),Allocator(INVNO,LEDGER,NL,PAYEE))))([@INVNO],[@LEDGER],[@NL],[@Payee])

Open in new window

or:

=LAMBDA(INVNO,LEDGER,NL,PAYEE,
LET(many,ManyPaid(NL,RAs[[#All],[LOOKUP]]),
IF(many,
INDEX(RAs[[#All],[CrossRefs]],many,0),
Allocator(INVNO,LEDGER,NL,PAYEE))))
([@INVNO],[@LEDGER],[@NL],[@Payee])

and the Lambda called Allocator called from within is:
=LAMBDA(INVNO,LEDGER,NL,PAYEE,LET(Separator,",",csv,TEXTJOIN(Separator,1,PAYEE,NL,INVNO,TEXT(LEDGER,"00000000.00;-0000000.00")),IF(ISBLANK(LEDGER),"",csv)))

or:
LAMBDA(INVNO,LEDGER,NL,PAYEE,
LET(
Separator,",",
csv,TEXTJOIN(Separator,1,PAYEE,NL,INVNO,TEXT(LEDGER,"00000000.00;-0000000.00")),

IF(ISBLANK(LEDGER),"",csv)))

Edit:and another sub LAMBDA within is:
LAMBDA(CQS,LOOKSEE,IFNA(MATCH(CQS,LOOKSEE,0),0))


Apparently this file does run ok on some PC versions (at least one) of Excel. To reproduce the crash, first sort on Data sheet column O and then column A. If that does work then it just crashes shortly after or crashes on save.

This question is a focussed Lambda/formula question after several questions about these crash/8192 errors.

Here is the file, this formula is in DATA sheet Column headed Allocator, col  AI .

GVXkeeping37DEVoriginal.xlsx

Changing the name LOOKUP to LOOKUPQ makes no difference. That was checking for conflicted names.

I have provided feedback to MS on all this.

Anthony
Mac, MS 365 Sub, Beta channel.

Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Anthony Mellor
Avatar of Anthony Mellor
Anthony Mellor
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Any improvements on this?

=IF([@LEDGER]=0,"",IFERROR(INDEX(RAs[CrossRefs],MATCH([@NL],RAs[LOOKUPQ],0),0),TEXTJOIN(",",1,[@Payee],[@NL],[@INVNO],TEXT([@LEDGER],"00000000.00;-0000000.00"))))

Open in new window

=IF(
[@LEDGER]=0,"",           IF CONDITION
IFERROR(
INDEX(RAs[CrossRefs],MATCH([@NL],RAs[LOOKUPQ],0),0),              IF YES
TEXTJOIN(",",1,[@Payee],[@NL],[@INVNO],TEXT([@LEDGER],"00000000.00;-0000000.00")).   IF NO
) END IFERROR
) END IF
Avatar of Anthony Mellor

ASKER

Gotta say, I am noticing how using LAMBDAs and LETS can create a great deal of complexity that sometimes is not necessary.

So a considered choice will be wise, indeed they may work better for prototyping logic before final application, because they allow compartmentalising sections of that logic.

Anthony
Avatar of Anthony Mellor

ASKER


   =IF(
      [@LEDGER]=0,"",           IF CONDITION
         IFERROR(
               INDEX(RAs[CrossRefs],MATCH([@NL],RAs[LOOKUPQ],0),0),              IF YES
               TEXTJOIN(",",1,[@Payee],[@NL],[@INVNO],TEXT([@LEDGER],"00000000.00;-0000000.00")).   IF NO
         ) END IFERROR
   ) END IF

That just my attempt at indenting... in case saqib happens along ..

Anthony
ASKER CERTIFIED SOLUTION
Avatar of Anthony Mellor
Anthony Mellor
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo