Forum Discussion
Xlookup - If_not_found not working
- May 27, 2021
How about
=IFERROR(SUM(XLOOKUP(J3,'M&E Data'!A:A,'M&E Data'!B:B):XLOOKUP(Calculations!J3,'M&E Data'!A:A,XLOOKUP(BSC!$V$3,'M&E Data'!B$3:M$3,'M&E Data'!B:M),0)),0)
HansVogelaar =XLOOKUP(TRUE,ISNUMBER(SEARCH(AMAZONDATA!A:A,C8)),AMAZONDATA!B:B,XLOOKUP(TRUE,ISNUMBER(SEARCH(AMAZONDATA!F:F,C8)),AMAZONDATA!B:B,""))
For the [if_not_found] section, I want the formula to reattempt the search in a different column (F) and return that data. Is this incorrect?
Try this version:
=XLOOKUP(C8, AMAZONDATA!A:A, AMAZONDATA!B:B, XLOOKUP(C8, AMAZONDATA!F:F, AMAZONDATA!B:B, ""))
- HLowellAug 21, 2023Copper Contributor
HansVogelaar Yeah, I had to keep it "dirty" as the values in the AMAZONDATA! sheet contain less characters than the Values being referenced on the main sheet. Imported data has the apostrophe to indicate text follows, so it's not an exact match reference. That's how I landed on the (TRUE,ISNUMBER(SEARCH( )) for [lookup_value][lookup_array]
- HansVogelaarAug 21, 2023MVP
And? Does your formula work?
- HLowellAug 21, 2023Copper ContributorAppologies, no. The [if_not_found] values show up as 0 instead of searching the second Column (F). I am having difficulties figuring out how to return a different value when Column A fails the cross-reference.