Index, Match - with 2 "contains" conditions

psrs0810

Well-known Member
Joined
Apr 14, 2009
Messages
1,109
I have a long file path that I am trying to match up to a table so that I can pull in the needed reports. How can I add in 2 "contain" formulas to identify the report path?
for example, I have one column that would have a location: BMH
then I have another column that would have a department number: 1005
so in the sample below, it would bring back the second report path.

E:\Productivity\ActionOI\Reports\Calendar 2022\Annual\Custom Comparison 40%\BMHa-ccr-Pediatrics_1006.PDF
E:\Productivity\ActionOI\Reports\Calendar 2022\Annual\Custom Comparison 40%\BMHa-ccr-Perinatal Testing Center_1005.PDF
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,
With cell A1 for BMH and cell B1 for 1005, you can test following:

Excel Formula:
="E:\Productivity\ActionOI\Reports\Calendar  2022\Annual\Custom Comparison 40%\"&A1&"*"&B1&".PDF"
 
Upvote 0
delme.xlsx
ABCDEF
1PathLocationDepartment No.Path
2E:\Productivity\ActionOI\Reports\Calendar 2022\Annual\Custom Comparison 40%\BMHa-ccr-Pediatrics_1006.PDFBMH1005E:\Productivity\ActionOI\Reports\Calendar 2022\Annual\Custom Comparison 40%\BMHa-ccr-Perinatal Testing Center_1005.PDF
3E:\Productivity\ActionOI\Reports\Calendar 2022\Annual\Custom Comparison 40%\BMHa-ccr-Perinatal Testing Center_1005.PDFBMH1006E:\Productivity\ActionOI\Reports\Calendar 2022\Annual\Custom Comparison 40%\BMHa-ccr-Pediatrics_1006.PDF
4BMZ1006#N/A
5BMH2006#N/A
6
Sheet1
Cell Formulas
RangeFormula
E2:E5E2=INDEX($A$2:$A$3,MATCH(TRUE,ISNUMBER(SEARCH(C2,$A$2:$A$3)*SEARCH(D2,$A$2:$A$3)),0))
 
Upvote 0
JGordon - I tried your formula and it worked perfectly - thank you both for replying
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

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