IF ERROR match formula - trying to replace #NA with blank. Formula worked fine until I added a search in another worksheet :(

jarem

New Member
Joined
Feb 25, 2022
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I had a simple formula that worked fine - I had a cell that I wanted to search another worksheet, and if it found a match, populate the text in that cell:
=IFERROR(INDEX(Sheet1!$A:$A,MATCH(B16,Sheet1!$G:$G,0)),””)

But then I needed it to look in two separate worksheets and populate the cell if there is a match:
=IFERROR(INDEX(Sheet1!$A:$A,MATCH(B16,Sheet1!$G:$G,0)),INDEX(Sheet2!$A:$A,MATCH(B16,Sheet2!$B:$B,0)))

I know this must be simple but I can't figure it out - I can no longer add in the "" to have it be blank if there is no match returned & now I get an #NA error.

Any suggestions would be greatly appreciated!!!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi & welcome to MrExcel.
Do you want to return the value from sheet1 if it exists & if it doesn't exist search sheet2?
 
Upvote 0
Yes, that is right. And if nothing is in either place, for it to return a blank

In an ideal world, there should never been two matches in both places - so I wouldn't mind an error message if there were matches in both but I'd be happy to fix the #NA error
 
Upvote 0
Ok, how about
Excel Formula:
=IFNA(INDEX(Sheet1!$A:$A,MATCH(B16,Sheet1!$G:$G,0)),IFNA(INDEX(Sheet2!$A:$A,MATCH(B16,Sheet2!$B:$B,0)),""))
 
Upvote 0
Solution
This fixed it!! Thank you soooo much, I spend an embarrassing amount of time trying to figure that out on my own. Much appreciated!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

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