Inbedded Trim in a complex Index Match MMULT formula

%3CLINGO-SUB%20id%3D%22lingo-sub-1423397%22%20slang%3D%22en-US%22%3EInbedded%20Trim%20in%20a%20complex%20Index%20Match%20MMULT%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1423397%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20working%20on%20setting%20up%20a%20reconciliation%2C%20and%20I%20need%20to%20lookup%20Placement%20numbers%20on%20the%20reconciliation.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20looking%20up%20against%20the%20invoice%20no.%2C%20and%20this%20is%20index%20matched%20against%20four%20different%20tables%20to%20find%20the%20placement%20number.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20enter%20the%20formula%20in%20my%20reconciliation%2C%20it%20does%20for%20the%20most%20part%20successfully%20look%20up%20the%20result%20from%20the%20four%20tables.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%20in%20other%20instances%2C%20the%20result%20does%20get%20identified.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20were%20to%20trim%20the%20data%20in%20the%20reconciliation%2C%20it%20will%20successfully%20lookup%20the%20missing%20data%2C%20however%20conversely%20the%20data%20that%20was%20looked%20up%20will%20no%20long%20be%20found.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20trim%20data%20in%20the%20reconciliation%2C%20however%20the%20Tables%20that%20I%20am%20looking%20up%20will%20not%20support%20this.%3C%2FP%3E%3CP%3EI%20have%20tried%20to%20integrate%20the%20trim%20into%20my%20lookup%20formula%2C%20however%20had%20not%20had%20success.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3DIFERROR(IFERROR(IFERROR(IFERROR(INDEX(Tbl_PLC%5B%5B%23All%5D%2C%5BPlacement%3A%20Placement%5D%5D%2CMATCH(1%2CMMULT(--(Tbl_PLC%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D%3D%5B%40%5BInvoice%20No%5D%5D)%2CTRANSPOSE(COLUMN(Tbl_PLC%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C))%2CINDEX(Tbl_Logix_CM%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(Tbl_Logix_CM%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D%3D%5B%40%5BInvoice%20No%5D%5D)%2CTRANSPOSE(COLUMN(Tbl_Logix_CM%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2CINDEX(Tbl_Logix_Prior%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(Tbl_Logix_Prior%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D%3D%5B%40%5BInvoice%20No%5D%5D)%2CTRANSPOSE(COLUMN(Tbl_Logix_Prior%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2CINDEX(Tbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(Tbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D%3D%5B%40%5BInvoice%20No%5D%5D)%2CTRANSPOSE(COLUMN(Tbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2C%22%22)%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1423397%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1423589%22%20slang%3D%22en-US%22%3ERe%3A%20Inbedded%20Trim%20in%20a%20complex%20Index%20Match%20MMULT%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1423589%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F486340%22%20target%3D%22_blank%22%3E%40MrStern%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20didn't%20provide%20any%20explanation.%20So%20I%20made%20some%20assumptions.%3C%2FP%3E%3CP%3ESolution%20is%20done%20with%20Power%20Query.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1423731%22%20slang%3D%22en-US%22%3ERe%3A%20Inbedded%20Trim%20in%20a%20complex%20Index%20Match%20MMULT%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1423731%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F486340%22%20target%3D%22_blank%22%3E%40MrStern%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20if%20you're%20not%20prepared%20to%20cleanse%20the%20data%20within%20your%20tables%20then%20you're%20going%20to%20have%20to%20apply%20TRIM%20across%20all%20relevant%20references%20within%20your%20formula.%20(%3CEM%3ESee%20edit%20below%3A%20it%20does%20not%20appear%20that%20TRIM%20Is%20required%20for%20the%20four%20source%20tables%3C%2FEM%3E).%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPersonally%20I'd%20name%20all%20table%20headers%20consistently%20%3CEM%3EPlacement%20ID%3C%2FEM%3E%3A%20%3CSTRONG%3ETBL_PLC%3C%2FSTRONG%3E%20currently%20has%20%3CEM%3EPlacement%3A%20Placement%3C%2FEM%3E%20as%20the%20header%2C%20which%20I'd%20change%20so%20as%20to%20align%20with%20the%20other%20three%20tables.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20although%20I%20don't%20usually%20recommend%20volatile%20solutions%20over%20non-volatile%20ones%2C%20perhaps%20here%20the%20reduction%20in%20formula%20length%20is%20worth%20it.%20As%20such%2C%20I%20might%20prefer%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000080%22%3E%3CSTRONG%3E%3DINDEX(INDIRECT(LOOKUP(1%2C0%2FCOUNTIF(INDIRECT(MyTables%26amp%3B%22%5B%23All%5D%22)%2CTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CMyTables)%26amp%3B%22%5BPlacement%20ID%5D%22)%2CIFERROR(MATCH(TRIM(%5B%40%5BInvoice%20No%5D%5D)%2CTRIM(INDIRECT(LOOKUP(1%2C0%2FCOUNTIF(INDIRECT(MyTables%26amp%3B%22%5B%23All%5D%22)%2CTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CMyTables)%26amp%3B%22%5BInvoice%20Number%5D%22))%2C0)%2CMATCH(TRIM(%5B%40%5BInvoice%20No%5D%5D)%2CTRIM(INDIRECT(LOOKUP(1%2C0%2FCOUNTIF(INDIRECT(MyTables%26amp%3B%22%5B%23All%5D%22)%2CTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CMyTables)%26amp%3B%22%5BCredit%20Note%20Number%5D%22))%2C0)))%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewhere%20%3CEM%3EMyTables%3C%2FEM%3E%20is%20defined%20within%20Name%20Manager%2C%20viz%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EName%3C%2FEM%3E%3A%26nbsp%3B%3CFONT%20color%3D%22%23000080%22%3E%3CSTRONG%3E%3CEM%3EMyTables%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CEM%3ERefers%20to%3C%2FEM%3E%3A%26nbsp%3B%3CFONT%20color%3D%22%23000080%22%3E%3CSTRONG%3E%3D%7B%22TBL_PLC%22%3B%22Tbl_Logix_CM%22%3B%22Tbl_Logix_Prior%22%3B%22Tbl_Logix_Cutoff%22%7D%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20I%20understand%20if%20you%20want%20to%20retain%20your%20original%20set-up%2C%20which%2C%20with%20the%20required%20TRIM%20functions%2C%20would%20be%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000080%22%3E%3CSTRONG%3E%3DIFERROR(IFERROR(IFERROR(IFERROR(INDEX(TBL_PLC%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(TRIM(TBL_PLC%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%3DTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CTRANSPOSE(COLUMN(TBL_PLC%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C))%2CINDEX(Tbl_Logix_CM%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(TRIM(Tbl_Logix_CM%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%3DTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CTRANSPOSE(COLUMN(Tbl_Logix_CM%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2CINDEX(Tbl_Logix_Prior%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(TRIM(Tbl_Logix_Prior%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%3DTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CTRANSPOSE(COLUMN(Tbl_Logix_Prior%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2CINDEX(Tbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(TRIM(Tbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%3DTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CTRANSPOSE(COLUMN(Tbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2C%22%22)%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSTRONG%3EEdit%3C%2FSTRONG%3E%3C%2FEM%3E%3A%20after%20further%20study%2C%20it%20appears%20that%20the%20entries%20in%20the%20four%20separate%20tables%20do%20not%20in%20fact%20require%20trimming.%20However%2C%20since%20TRIM%20coerces%20numbers%20to%20text%2C%20it%20will%20still%20be%20necessary%20to%20coerce%20the%20values%20in%20those%20tables%20into%20text%20in%20order%20for%20MATCH%20to%20recognise%20them.%20By%20a%20lucky%20coincidence%2C%20TRIM%20will%20actually%20do%20this%20(i.e.%20convert%20numbers%20to%20text)%2C%20so%20the%20above%20solution%20will%20work%3B%20however%2C%20the%20use%20of%20TRIM%20to%20coerce%20numbers%20to%20text%20is%20abstruse%3A%20the%20following%20version%20is%20more%20logical%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000080%22%3E%3CSTRONG%3E%3DIFERROR(IFERROR(IFERROR(IFERROR(INDEX(TBL_PLC%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(%22%22%26amp%3BTBL_PLC%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D%3DTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CTRANSPOSE(COLUMN(TBL_PLC%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C))%2CINDEX(Tbl_Logix_CM%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(%22%22%26amp%3BTbl_Logix_CM%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D%3DTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CTRANSPOSE(COLUMN(Tbl_Logix_CM%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2CINDEX(Tbl_Logix_Prior%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(%22%22%26amp%3BTbl_Logix_Prior%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D%3DTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CTRANSPOSE(COLUMN(Tbl_Logix_Prior%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2CINDEX(Tbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BPlacement%20ID%5D%5D%2CMATCH(1%2CMMULT(--(%22%22%26amp%3BTbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D%3DTRIM(%5B%40%5BInvoice%20No%5D%5D))%2CTRANSPOSE(COLUMN(Tbl_Logix_Cutoff%5B%5B%23All%5D%2C%5BInvoice%20Number%5D%3A%5BCredit%20Note%20Number%5D%5D)%5E0))%2C)))%2C%22%22)%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1424302%22%20slang%3D%22en-US%22%3ERe%3A%20Inbedded%20Trim%20in%20a%20complex%20Index%20Match%20MMULT%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1424302%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F676180%22%20target%3D%22_blank%22%3E%40Jos_Woolley%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20That%20worked%20a%20treat!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1424317%22%20slang%3D%22en-US%22%3ERe%3A%20Inbedded%20Trim%20in%20a%20complex%20Index%20Match%20MMULT%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1424317%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F486340%22%20target%3D%22_blank%22%3E%40MrStern%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou're%20very%20welcome!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1424318%22%20slang%3D%22en-US%22%3ERe%3A%20Inbedded%20Trim%20in%20a%20complex%20Index%20Match%20MMULT%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1424318%22%20slang%3D%22en-US%22%3EThis%20makes%20it%20difficult%20to%20use%20VLOOKUP%20to%20find%20a%20value%20based%20on%20more%20than%20one%20criteria.%20However%2C%20if%20you%20have%20control%20over%20the%20source%20data%2C%20you%20an%20add%20a%20helper%20column%20that%20concatenates%202%20more%20more%20fields%20together%2C%20then%20give%20VLOOKUP%20a%20lookup%20value%20that%20does%20the%20same.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I am working on setting up a reconciliation, and I need to lookup Placement numbers on the reconciliation.

 

I am looking up against the invoice no., and this is index matched against four different tables to find the placement number.

 

When I enter the formula in my reconciliation, it does for the most part successfully look up the result from the four tables.

 

However in other instances, the result does get identified.

 

If I were to trim the data in the reconciliation, it will successfully lookup the missing data, however conversely the data that was looked up will no long be found.

 

I can trim data in the reconciliation, however the Tables that I am looking up will not support this.

I have tried to integrate the trim into my lookup formula, however had not had success.

 

Any help would be appreciated.

 

{=IFERROR(IFERROR(IFERROR(IFERROR(INDEX(Tbl_PLC[[#All],[Placement: Placement]],MATCH(1,MMULT(--(Tbl_PLC[[#All],[Invoice Number]:[Credit Note Number]]=[@[Invoice No]]),TRANSPOSE(COLUMN(Tbl_PLC[[#All],[Invoice Number]:[Credit Note Number]])^0)),)),INDEX(Tbl_Logix_CM[[#All],[Placement ID]],MATCH(1,MMULT(--(Tbl_Logix_CM[[#All],[Invoice Number]:[Credit Note Number]]=[@[Invoice No]]),TRANSPOSE(COLUMN(Tbl_Logix_CM[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),INDEX(Tbl_Logix_Prior[[#All],[Placement ID]],MATCH(1,MMULT(--(Tbl_Logix_Prior[[#All],[Invoice Number]:[Credit Note Number]]=[@[Invoice No]]),TRANSPOSE(COLUMN(Tbl_Logix_Prior[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),INDEX(Tbl_Logix_Cutoff[[#All],[Placement ID]],MATCH(1,MMULT(--(Tbl_Logix_Cutoff[[#All],[Invoice Number]:[Credit Note Number]]=[@[Invoice No]]),TRANSPOSE(COLUMN(Tbl_Logix_Cutoff[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),"")}

5 Replies
Highlighted

@MrStern 

You didn't provide any explanation. So I made some assumptions.

Solution is done with Power Query.

 

 

Highlighted

@MrStern 

 

Yes, if you're not prepared to cleanse the data within your tables then you're going to have to apply TRIM across all relevant references within your formula. (See edit below: it does not appear that TRIM Is required for the four source tables).  

 

Personally I'd name all table headers consistently Placement ID: TBL_PLC currently has Placement: Placement as the header, which I'd change so as to align with the other three tables.

 

Also, although I don't usually recommend volatile solutions over non-volatile ones, perhaps here the reduction in formula length is worth it. As such, I might prefer:

 

=INDEX(INDIRECT(LOOKUP(1,0/COUNTIF(INDIRECT(MyTables&"[#All]"),TRIM([@[Invoice No]])),MyTables)&"[Placement ID]"),IFERROR(MATCH(TRIM([@[Invoice No]]),TRIM(INDIRECT(LOOKUP(1,0/COUNTIF(INDIRECT(MyTables&"[#All]"),TRIM([@[Invoice No]])),MyTables)&"[Invoice Number]")),0),MATCH(TRIM([@[Invoice No]]),TRIM(INDIRECT(LOOKUP(1,0/COUNTIF(INDIRECT(MyTables&"[#All]"),TRIM([@[Invoice No]])),MyTables)&"[Credit Note Number]")),0)))

 

where MyTables is defined within Name Manager, viz:

 

NameMyTables

Refers to={"TBL_PLC";"Tbl_Logix_CM";"Tbl_Logix_Prior";"Tbl_Logix_Cutoff"}

 

However, I understand if you want to retain your original set-up, which, with the required TRIM functions, would be:

 

=IFERROR(IFERROR(IFERROR(IFERROR(INDEX(TBL_PLC[[#All],[Placement ID]],MATCH(1,MMULT(--(TRIM(TBL_PLC[[#All],[Invoice Number]:[Credit Note Number]])=TRIM([@[Invoice No]])),TRANSPOSE(COLUMN(TBL_PLC[[#All],[Invoice Number]:[Credit Note Number]])^0)),)),INDEX(Tbl_Logix_CM[[#All],[Placement ID]],MATCH(1,MMULT(--(TRIM(Tbl_Logix_CM[[#All],[Invoice Number]:[Credit Note Number]])=TRIM([@[Invoice No]])),TRANSPOSE(COLUMN(Tbl_Logix_CM[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),INDEX(Tbl_Logix_Prior[[#All],[Placement ID]],MATCH(1,MMULT(--(TRIM(Tbl_Logix_Prior[[#All],[Invoice Number]:[Credit Note Number]])=TRIM([@[Invoice No]])),TRANSPOSE(COLUMN(Tbl_Logix_Prior[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),INDEX(Tbl_Logix_Cutoff[[#All],[Placement ID]],MATCH(1,MMULT(--(TRIM(Tbl_Logix_Cutoff[[#All],[Invoice Number]:[Credit Note Number]])=TRIM([@[Invoice No]])),TRANSPOSE(COLUMN(Tbl_Logix_Cutoff[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),"")

 

Edit: after further study, it appears that the entries in the four separate tables do not in fact require trimming. However, since TRIM coerces numbers to text, it will still be necessary to coerce the values in those tables into text in order for MATCH to recognise them. By a lucky coincidence, TRIM will actually do this (i.e. convert numbers to text), so the above solution will work; however, the use of TRIM to coerce numbers to text is abstruse: the following version is more logical:

 

=IFERROR(IFERROR(IFERROR(IFERROR(INDEX(TBL_PLC[[#All],[Placement ID]],MATCH(1,MMULT(--(""&TBL_PLC[[#All],[Invoice Number]:[Credit Note Number]]=TRIM([@[Invoice No]])),TRANSPOSE(COLUMN(TBL_PLC[[#All],[Invoice Number]:[Credit Note Number]])^0)),)),INDEX(Tbl_Logix_CM[[#All],[Placement ID]],MATCH(1,MMULT(--(""&Tbl_Logix_CM[[#All],[Invoice Number]:[Credit Note Number]]=TRIM([@[Invoice No]])),TRANSPOSE(COLUMN(Tbl_Logix_CM[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),INDEX(Tbl_Logix_Prior[[#All],[Placement ID]],MATCH(1,MMULT(--(""&Tbl_Logix_Prior[[#All],[Invoice Number]:[Credit Note Number]]=TRIM([@[Invoice No]])),TRANSPOSE(COLUMN(Tbl_Logix_Prior[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),INDEX(Tbl_Logix_Cutoff[[#All],[Placement ID]],MATCH(1,MMULT(--(""&Tbl_Logix_Cutoff[[#All],[Invoice Number]:[Credit Note Number]]=TRIM([@[Invoice No]])),TRANSPOSE(COLUMN(Tbl_Logix_Cutoff[[#All],[Invoice Number]:[Credit Note Number]])^0)),))),"")

 

Regards

Highlighted

@Jos_Woolley 

Thanks That worked a treat!

Highlighted

@MrStern 

 

You're very welcome!

Highlighted
This makes it difficult to use VLOOKUP to find a value based on more than one criteria. However, if you have control over the source data, you an add a helper column that concatenates 2 more more fields together, then give VLOOKUP a lookup value that does the same.