IFERROR, XLOOKUP returns 0 instead of value

j_saints

New Member
Joined
Sep 21, 2020
Messages
8
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
Hello,

I was hoping someone could help me fix this combination function below.

I have a company table and I want to lookup their parent company based on their keywords.

I'm trying to return "OTHER ACCOUNTS" if the lookup match is blank/error. For some reason, it's returning to 0.

Excel Formula:
=IFERROR(XLOOKUP(TRUE,ISNUMBER(SEARCH('PARENT COMPANY'!$A:$A,'COMPANY TABLE'!B1501)),'PARENT COMPANY'!$C:$C),"OTHER ACCOUNTS")

Any help is much appreciated!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Switch the ranges in the SEARCH formula. That is the find text should be B1501.
 
Upvote 0
Try:
IFERROR(XLOOKUP(TRUE,ISNUMBER(SEARCH('PARENT COMPANY'!$A:$A,'COMPANY TABLE'!B1501)),'PARENT COMPANY'!$C:$C),),"OTHER ACCOUNTS")
 
Upvote 0
Maybe
Excel Formula:
=XLOOKUP("*"&'COMPANY TABLE'!B1501&"*",'PARENT COMPANY'!$A:$A,'PARENT COMPANY'!$C:$C,"OTHER ACCOUNTS",2)
 
Upvote 0
If you want an exact match but to return "OTHER ACCOUNT" in both of the following:
  • Not Found
  • Found but C is blank
Then this should work:-
Excel Formula:
=XLOOKUP(1,ISNUMBER(SEARCH('COMPANY TABLE'!B1501,'PARENT COMPANY'!$A:$A))*('PARENT COMPANY'!$C:$C<>""),'PARENT COMPANY'!$C:$C,"OTHER ACCOUNTS")
 
Upvote 0
Good spot, Alex!

I hadn't considered the lookup result being an empty cell. Trying to do it without arrays, although this is still on the assumption that the observation made in post 2 is correct.
Excel Formula:
=LET(x,XLOOKUP("*"&'COMPANY TABLE'!B1501&"*",'PARENT COMPANY'!$A:$A,'PARENT COMPANY'!$C:$C,0,2),IF(x=0,"Other Accounts",x))
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,178
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top