Extract numbers either side of text

I_AM

Board Regular
Joined
Jul 2, 2002
Messages
141
Hello.
I wish to extract a variable sized number from either side of text
Assuming the following is in D1,
10 vs 25 I wish to extract 10 to one cell, 25 to another
1 vs 125 I wish to extract 1 to one cell, 125 to another
0 vs 2 I wish to extract 0 to one cell, 2 to another
All with a single formula.
Extracting with
=LEFT(D1, FIND(CHAR(32), D1)-0)+0 works well with LEFT, not so using the same with RIGHT.

The numbers extracted I wish to add using:
=SUMIFS(A1:A10,B1:B10,C1)
The result of =LEFT(D1, FIND(CHAR(32), D1)-0)+0 are added, yet the results of =LEFT(D1, FIND(CHAR(32), D1)-0) are not?

I think I'm after everything LEFT of the first CHAR(32) and everything RIGHT of the second CHAR(32)?

Thank you.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Not sure I understand what you want to be "All with a single formula".
Is this of any use?
Book1
ABCD
1102510 vs 25
211251 vs 125
3020 vs 2
Sheet1
Cell Formulas
RangeFormula
A1:A3A1=LEFT(D1,SEARCH("vs",D1)-1)+0
B1:B3B1=MID(D1,SEARCH("vs",D1)+3,LEN(D1))+0
 
Upvote 0
Not sure I understand what you want to be "All with a single formula".
Is this of any use?
Book1
ABCD
1102510 vs 25
211251 vs 125
3020 vs 2
Sheet1
Cell Formulas
RangeFormula
A1:A3A1=LEFT(D1,SEARCH("vs",D1)-1)+0
B1:B3B1=MID(D1,SEARCH("vs",D1)+3,LEN(D1))+0
Perfect. Thank you.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have 365 you could also use
Fluff.xlsm
ABCD
1102510 vs 25
211251 vs 125
3020 vs 2
Main
Cell Formulas
RangeFormula
A1:B3A1=--TEXTSPLIT(D1,"vs")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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