Extract text between reoccurring characters

razorback1530

New Member
Joined
Mar 15, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I want to extract the text between dashes and after the equal signs. The format of the text is as follows: 6.9-23.4-7.2-S=6.3-Cl=0.6-Mg=3.4
I would like the following text in each column:
A - 6.9
B - 23.4
C - 7.2
D - 6.3 (1st equal sign)
E - 0.6 (2nd equal sign)
F - 3.4 (3rd equal sign)

I have been successful in getting the text for columns A, B and C only.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Try this

Book1
ABCDEFG
16.9-23.4-7.2-S=6.3-Cl=0.6-Mg=3.46.923.47.26.30.63.4
Sheet1
Cell Formulas
RangeFormula
B1:D1B1=TRIM(MID(SUBSTITUTE("-"&$A1,"-",REPT(" ",100)),COLUMNS($B1:B1)*100,100))
E1:G1E1=TRIM(MID(SUBSTITUTE(SUBSTITUTE($A1,"=","-"),"-",REPT(" ",100)),COLUMNS($E1:E1)*200+200,100))
 
Upvote 0
Hi,

If All your text strings are in the Exact same format as your 1 sample:

Book3.xlsx
ABCDEF
16.9-23.4-7.2-S=6.3-Cl=0.6-Mg=3.4
26.923.47.26.30.63.4
Sheet841
Cell Formulas
RangeFormula
A2:F2A2=TRIM(MID(SUBSTITUTE(SUBSTITUTE("-"&$A1,"-",REPT(" ",100)),"=",REPT(" ",100)),IF(COLUMNS($A2:A2)<=3,COLUMNS($A2:A2),COLUMNS($A2:A2)*2-3)*100,100))
 
Upvote 0
Another option
+Fluff 1.xlsm
ABCDEFG
1
26.9-23.4-7.2-S=6.3-Cl=0.6-Mg=3.46.9023.407.206.300.603.40
Master
Cell Formulas
RangeFormula
B2:G2B2=TRANSPOSE(FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE(A2,"=","-"),"-","</m><m>")&"</m></k>","//m[contains(.,*)and number()]"))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,024
Messages
6,122,729
Members
449,093
Latest member
Mnur

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