Need assistance with Index Match

it's an excel world

Board Regular
Joined
Sep 17, 2008
Messages
126
Hello all,

I am trying to write a formula that performs a partial search in column P identify the tab to pull some data back using the index match function. Here is what I have so far. I'm not sure what I am doing wrong, but the when I copy the formula down the file it appears not to make it past the first IF. If Bike does not appear in column P, I receive the # Value! error.

=IF(SEARCH("Bike",P2),INDEX(Bike!$B$2:$K$151,MATCH(RawData!BK2,Bike!$A$2:$A$151,0),MATCH(RawData!BJ2,Bike!$B$1:$K$1,0)),IF(SEARCH("Scooter",P2),INDEX(Scooter!$B$2:$H$152,MATCH(RawData!BK2,Scooter!$A$2:$A$152,0),MATCH(RawData!BJ2,Scooter!$B$1:$H$1,0)),IF(SEARCH("Car",P2),INDEX(Car!$B$2:$H$152,MATCH(RawData!BK2,Car!$A$2:$A$152,0),MATCH(RawData!BJ2,Car!$B$1:$H$1,0)),"")))

Thanks in advance!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
That's because if "Bike" isn't found in P2 then search will retuen an error, try

IF(ISNUMBER(SEARCH("Bike",P2)),...

Or alternatively use a different function, for example

=IFERROR(CHOOSE(MATCH(P2,{"Bike","Scooter","Car"},0),INDEX(Bike!$B$2:$K$151,MATCH(RawData!BK2,Bike!$A$2:$A$151,0),MATCH(RawData!BJ2,Bike!$B$1:$K$1,0)),INDEX(Scooter!$B$2:$H$152,MATCH(RawData!BK2,Scooter!$A$2:$A$152,0),MATCH(RawData!BJ2,Scooter!$B$1:$H$1,0)),INDEX(Car!$B$2:$H$152,MATCH(RawData!BK2,Car!$A$2:$A$152,0),MATCH(RawData!BJ2,Car!$B$1:$H$1,0))),"")
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,223
Members
452,896
Latest member
IGT

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