excel problem extract text and numbers from text string

pcbmaniac

New Member
Joined
Nov 20, 2015
Messages
6
Hi all,

i 'm looking for solution to the following problem:

i have a string at B1 and C1 columns like this:
bread1 item 330 calories
apple sugar300g 1232 calories
tost110g 250 calories

<tbody>
</tbody>

etc...

All i want is text extraction like:
D1 column E1 column
1 item330 calories
300 g1232 calories
110g250 calories

<tbody>
</tbody>
How can i achieve this results?

TIA
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi,

Try this

D1 =LEFT(LEFT(C1,-1-LOOKUP(,-FIND(" ",C1,ROW($1:$99)))),-1-LOOKUP(,-FIND(" ",LEFT(C1,-1-LOOKUP(,-FIND(" ",C1,ROW($1:$99)))),ROW($1:$99))))

E1 =RIGHT(C1,13)
 
Upvote 0
Hi,

Try this

D1 =LEFT(LEFT(C1,-1-LOOKUP(,-FIND(" ",C1,ROW($1:$99)))),-1-LOOKUP(,-FIND(" ",LEFT(C1,-1-LOOKUP(,-FIND(" ",C1,ROW($1:$99)))),ROW($1:$99))))

E1 =RIGHT(C1,13)


Great solution just slight improvement on your D1 formula

Code:
=(LEFT(RIGHT(C2,13),4)*1)&" Calories"

removes the space from 3 digit calorie counts
 
Upvote 0
Here is another solution for you to consider...

D1: =TRIM(SUBSTITUTE(C1,E1,""))

E1: =TRIM(LEFT(RIGHT(SUBSTITUTE(C1," ",REPT(" ",100)),200),200))
 
Upvote 0
I must say thank you all for the possible solutions.
I 'am Greek and i used the above tables just to make a simulation of real problem witch has greek words.
Here is the results so far:

Real Data above:
B1 C1 D1 E1

<colgroup><col><col><col><col><col></colgroup><tbody></tbody>
ΑβοκάντοςΈνα/μία 315 ΘερμίδεςΈνα/μία 315 Θερμίδες
Αβοκάντος (Φρέσκο Ωμό)1 κιλό 1253 Θερμίδες1 κιλό1253 Θερμίδες
ΑγγούριΈνα/μία 36 ΘερμίδεςΈνα/μίαα 36 Θερμίδες
Αγγούρι raita (Ινδικό)Κουτάλι Σούπας 20 ΘερμίδεςΚουτάλι Σούπαςς 20 Θερμίδες

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

As you can see, the 1st solution was almost perfect except the extra character it extracts like in Ε1 3rd row "α" and E1 4th row "ς"

If i elliminate this, the problem will be fixed!

TIA again :)
 
Upvote 0
In D1 and copy down

Code:
[B]=TRIM(LEFT(C1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},C1&1/17,FIND(" ",C1)))-1))[/B]

then in E1

Code:
[B]=TRIM(SUBSTITUTE(C1,D1,""))[/B]


Excel 2010
BCDE
1bread1 item 330 calories1 item330 calories
2apple sugar300g 1232 calories300g1232 calories
3tost110g 250 calories110g250 calories
Sheet7
 
Upvote 0

Forum statistics

Threads
1,215,493
Messages
6,125,131
Members
449,206
Latest member
burgsrus

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