INDEX MATCH from two worksheets

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
sorry for the not complete message be shown

My complete question shown below :
I have a formula in `Sheet6` to look up a value from `Sheet5` and return it, but sometimes, if values are not in `Sheet5`, I want it to check in `Sheet7`.

`Sheet6` and `Sheet7` have same pattern in all column, only columns have different values.


How can I rewrite the formula in `Sheet 6` in order to check data in `sheet 5` first and if data were not found, then `Sheet7` will be automatically matched?


**Original formula in `Sheet 6`:**
=IF(ISNA(INDEX(Sheet5!$A$4:$AG$30,MATCH($C$6,Sheet5!C4:C30,0),2)),"",INDEX(Sheet5!$A$4:$AG$30,MATCH($C$6, Sheet5!C4:C30,0),2))


Screenshots below to clarify my question
[sheet5]: https://i.stack.imgur.com/nbBHL.jpg
[sheet6]: https://i.stack.imgur.com/YstX8.jpg
[sheet7]: https://i.stack.imgur.com/qf4UF.jpg

I‘ve tried, but seem not work
Hope anyone can try to provide help.
Any help appreciated
 
Upvote 0
What about:

=IFERROR(INDEX(Sheet5!$A$4:$AG$30,MATCH($C$6,Sheet5!C4:C30,0),2),INDEX(Sheet7!$A$4:$AG$30,MATCH($C$6, Sheet7!C4:C30,0),2))

The formula tries to calculate the first part of the IFERROR statement and if successful then you get your value from Sheet5. If it produces an error because it can't match the value in Sheet5, it calculates the second part instead and pulls the value from Sheet7.

 
Upvote 0

Forum statistics

Threads
1,216,054
Messages
6,128,516
Members
449,456
Latest member
SammMcCandless

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