Extract data from a column if the string matches multiple criterion

excelvbanoob420

New Member
Joined
Oct 5, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hello,

I need help in extracting data from 'Data Column' as shown below. The string match condition that I'm looking for are "FM-" as shown in ID#1, "FM x" (FM with a space followed by a number x) as shown in ID#9 & "FMx" where x is a number as shown in ID#6. Any other FM's not meeting the above 3 criterias should be ignored. Is it possible to extract the sample data in another column?

Thanks!

IDData ColumnOutput
1​
Hello from FM-223, Random FM FM FMFM-223
2​
Sample Data XXXXXXNull
3​
Sample Data XXXXXXNull
4​
Sample Data XXXXXXNull
5​
Sample Data XXXXXXNull
6​
Hi from FM212…..XXXXX sample FM to be ignoredFM212
7​
Lorem IpsumNull
8​
placeholder textNull
9​
Bye FM 444 FM488 yes, more FMto be ignoredFM 444
FM488
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I see you wanted both qualifying FM values in ID#9 retrieved, in different cells in the same column. That was an easy example for you to show us as ID#9 was the last ID in the column, but what if such text happened in ID#6 instead? Should the output go in the Output column for the rows opposite ID#6 and ID#7? If so, where would the output go if such text was in both ID#6 and ID#7? Even more confusing, what if ID#6 and ID#9 had text with 2 qualifying FM values and ID#7 had text with 4 qualifying FM values so that ID#6 would overlap ID#7 and ID#7's 4 values would overlap ID#9's location? Basically, I do not understand your rules for outputting the qualifying FM values.
 
Upvote 0
I see you wanted both qualifying FM values in ID#9 retrieved, in different cells in the same column. That was an easy example for you to show us as ID#9 was the last ID in the column, but what if such text happened in ID#6 instead? Should the output go in the Output column for the rows opposite ID#6 and ID#7? If so, where would the output go if such text was in both ID#6 and ID#7? Even more confusing, what if ID#6 and ID#9 had text with 2 qualifying FM values and ID#7 had text with 4 qualifying FM values so that ID#6 would overlap ID#7 and ID#7's 4 values would overlap ID#9's location? Basically, I do not understand your rules for outputting the qualifying FM values.
Thank you for your reply and apologies for the confusion. In case of 2 qualifying FM values, output should be in the same (I fixed it). Secondly, I added a pre-condition column, which should be checked for "Valid" values before outputting the FM values.
Thanks in advance for the help.

IDData ColumnPreconditionOutput
1Hello from FM-223, Random FM FM FMValidFM-223
2Sample Data XXXXXXNot ValidNull
3Sample Data XXXXXXValidNull
4Sample Data XXXXXXValidNull
5Sample Data XXXXXXValidNull
6Hi from FM212…..XXXXX sample FM to be ignoredValidFM212
7Lorem IpsumValidNull
8placeholder textValidNull
9Bye FM 444 FM488 yes, more FMto be ignoredValidFM 444
FM488
10Hi from FM500Not ValidNull
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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