Multiple Find Function Generating Error

DangerKennedy

New Member
Joined
Dec 8, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hey, I am looking for a function I can use to find the words "MS", "IV", "FM", and "XR" from a cell of data. I currently have this formula that words for just "XR" below and returns : XR0551AJ to my cell in A1.

=TRIM(LEFT(SUBSTITUTE(MID(Q1,FIND("XR",Q1),LEN(Q1))," ",REPT(" ",100)),100))

How can I manipulate this formula this include other find criteria mentioned above in case it has something like Geisinger Bayer Contract Media MS5018 Tiered Pricing?

Example Data in my Q column:

Geisinger Bayer Contrast Media XR0551AJ Tiered Pricing
Geisinger Bayer Contrast Media MS5018 Tiered Pricing
Geisinger Bayer Contrast Media IV200111 Tiered Pricing
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Maybe this way, drag down as required
Excel Formula:
=IF(OR(COUNTIF(Q1, "*XR*"),COUNTIF(Q1, "*MS*"),COUNTIF(Q1, "*IV*")),Q1, "No")
 
Upvote 0
Maybe this way, drag down as required
Excel Formula:
=IF(OR(COUNTIF(Q1, "*XR*"),COUNTIF(Q1, "*MS*"),COUNTIF(Q1, "*IV*")),Q1, "No")
This is close! My results are:
Kimberly-Clark Sanitary Paper FM0393 Tiered Pricing
I am looking for the result: FM0393
 
Upvote 0
I'm sure there will be a much shorter version.....
Excel Formula:
=IF(OR(COUNTIF(Q2, "*XR*"),COUNTIF(Q2, "*MS*"),COUNTIF(Q2, "*IV*")),MID(Q2,SEARCH("Media",Q2)+6,SEARCH("Tiered",Q2)-SEARCH("Media",Q2)-6), "Nothing")
 
Upvote 0
Another option
Excel Formula:
=LET(a,TEXTSPLIT(Q2," "),FILTER(a,(LEFT(a,2)="xr")+(LEFT(a,2)="ms")+(LEFT(a,2)="IV")+(LEFT(a,2)="fm"),""))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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