Finding Text/Number Combinations w/in Text String

cjvenables

Board Regular
Joined
Aug 2, 2011
Messages
65
Hello,

I need to find a way to pull text/numbers together out of a cell.

This is my text in cell M1:

000184.00@000040.99:CC#008661 FSR#5108434 PROVIDE

This is how I would like it to appear in my spreadsheet:

M1: 000184.00@000040.99:CC#008661 FSR#5108434 PROVIDE
N1: CC#008661
O1: FSR#5108434

Notes:

CC# and FSR# will always be present, but the numbers after them will be different, so I would need a formula or VBA script that accounts for that. They will have the same number of digits after (6 for CC# and 7 for FSR#).

I do not need any data before or after CC# and FSR#.

I have thousands of rows, so hopefully there is a good formula or VBA.

Thanks!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hello,

I need to find a way to pull text/numbers together out of a cell.

This is my text in cell M1:

000184.00@000040.99:CC#008661 FSR#5108434 PROVIDE

This is how I would like it to appear in my spreadsheet:

M1: 000184.00@000040.99:CC#008661 FSR#5108434 PROVIDE
N1: CC#008661
O1: FSR#5108434

Notes:

CC# and FSR# will always be present, but the numbers after them will be different, so I would need a formula or VBA script that accounts for that. They will have the same number of digits after (6 for CC# and 7 for FSR#).

I do not need any data before or after CC# and FSR#.

I have thousands of rows, so hopefully there is a good formula or VBA.

Thanks!
Try these:

For CC#:

=MID(M1,FIND("CC#",M1),9)

For FSR#:

=MID(M1,FIND("FSR#",M1),11)
 
Upvote 0
Formula for N1 =TRIM(MID(M1,FIND("CC#",M1,1), FIND("FSR#",M1,1)-3-FIND("CC#",M1,1)))
Formula for O1 =TRIM(MID(C30,FIND("FSR#",C30,1), FIND("PROVIDE",C30,1)-FIND("FSR#",C30,1)))

HTH,
Roger
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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