Index Match with Wildcards across multiple sheets

scorziello

New Member
Joined
Jun 11, 2021
Messages
16
Office Version
  1. 2016
Platform
  1. Windows
I am trying to use index match with a wildcard option between 2 sheets. I have this formula that works great if all the data is on one sheet.
Excel Formula:
=INDEX(C:C,MATCH("*"&F:F&"*",B:B,0))
I have attached a mini sheet of sheet 2 where you can see that when I use the same formula but with a wildcard I get an error. Sheet 3 shows the formula working.
sample.xlsx
AB
1logincohort
2loricewas233
3dolmosaaf515
4vjessehoae513
5fishtylfe381
6fishtylge265
Sheet1


sample.xlsx
ABC
1Cohorttitle
2#N/AGRR1 DL Productivity Retrain Request loricew
3#N/AGRR1 NA Quality Retrain Request - dolmosa
4#N/AGRR1 NA Quality Retrain Request - vjesseho
5#N/AGRR1 NA Quality Retrain Request - frankjna
6#N/AGRR1 RT Quality Retrain Request - fishtyl
Sheet2
Cell Formulas
RangeFormula
A2A2=INDEX(Sheet1!B:B,MATCH("*"&C:C&"*",Sheet1!A:A,0))
A3:A6A3=INDEX(Sheet1!D:D,MATCH("*"&C:C&"*",Sheet1!A:A,0))


sample.xlsx
ABCDEFG
1GRR1 DL Productivity Retrain Request loricewas233dolmosaaf515
2GRR1 NA Quality Retrain Request - dolmosaaf515frankjnafe381
3GRR1 NA Quality Retrain Request - vjessehoae513vjessehoae513
4GRR1 NA Quality Retrain Request - frankjnafe381fishtylge265
5GRR1 RT Quality Retrain Request - fishtylge265loricewas233
6
Sheet3
Cell Formulas
RangeFormula
G1:G5G1=INDEX(C:C,MATCH("*"&D:D&"*",B:B,0))
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You're getting an error because there are no matching entries in sheet 1.

edit:- I see what you're trying to do. There is a significant difference between the single sheet example and the 2 sheet example in that you have switched the long and short string columns around. For that, wildcards are the wrong way to to it. Theoretically you would need MATCH(C:C,"*"&Sheet1!A:A&"*",0) which is not valid syntax so an alternative method will be needed.
Excel Formula:
=INDEX(Sheet1!B:B,MATCH(TRIM(MID(C2,FIND("-",C2)+1,LEN(C2))),Sheet1!A:A,0))
 
Last edited:
Upvote 0
You're getting an error because there are no matching entries in sheet 1.

edit:- I see what you're trying to do. There is a significant difference between the single sheet example and the 2 sheet example in that you have switched the long and short string columns around. For that, wildcards are the wrong way to to it. Theoretically you would need MATCH(C:C,"*"&Sheet1!A:A&"*",0) which is not valid syntax so an alternative method will be needed.
Excel Formula:
=INDEX(Sheet1!B:B,MATCH(TRIM(MID(C2,FIND("-",C2)+1,LEN(C2))),Sheet1!A:A,0))
That works great!! Thank you so much. Now I just need to remove some unnecessary characters from some of the entries and it will work on my actual sheet. Sheet 2 Column C are subject lines from our support tickets and some people like to add brackets around the logins :( but I will tackle that tomorrow when I get back to the office.
 
Upvote 0
some people like to add brackets around the logins
That's easy enough, assuming standard brackets ( and )
Excel Formula:
=INDEX(Sheet1!B:B,MATCH(TRIM(SUBSTITUTE(SUBSTITUTE(MID(C2,FIND("-",C2)+1,LEN(C2)),"(",""),")","")),Sheet1!A:A,0))
Or educate people to do it properly, although that is often easier said than done. Could try telling them that adding brackets to the ID invalidates it for data analysis and makes in look like they are not performing adequately :eek:
 
Upvote 0
Solution
That is brilliant!! I will test this out when I get back to the office. Thank you.
 
Upvote 0
That did the trick!! Thank you so much for your help. I think I may try and make this into a macro to account for other variables but this gets me going in the right direction.
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

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