Extract Text or Number from a Cell

dcecilia

New Member
Joined
May 12, 2014
Messages
2
I have a file of 2000 rows I would like to Extract from each Cell the size of the product.

Example
Chlorella Powder 100g Organic

<tbody>
</tbody>

<tbody>
</tbody>
Chlorella Powder Organic
100g

<tbody>
</tbody>

<tbody>
</tbody>

The first row shows how it is at the moment the second row shows how I would like it to be.

I hope there's a formula.
Thanks
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I am assuming there is a better formula available, but until it is posted, try this...

Assuming your example text is in cell A1, put these formulas in the indicated cells...

B1: =SUBSTITUTE(A1," "&C1,"")

C1: =MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),FIND(" ",A1&" ",MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))-MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))
 
Upvote 0
@Rick, really like you trick in combining Numbers and " " to the original text. Brilliant!!!

Although not a better alternative, here's my trial.

B1
=SUBSTITUTE(A1,C1&" ","")

C1
=MID(A1,MIN(IF(ISNUMBER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)+0),ROW(INDIRECT("1:"&LEN(A1))))),MAX(IF(ISNUMBER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)+0),ROW(INDIRECT("1:"&LEN(A1)))))-MIN(IF(ISNUMBER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)+0),ROW(INDIRECT("1:"&LEN(A1)))))+2)
CTRL SHIFT ENTER
 
Upvote 0
I am assuming there is a better formula available, but until it is posted, try this...

Assuming your example text is in cell A1, put these formulas in the indicated cells...

B1: =SUBSTITUTE(A1," "&C1,"")

C1: =MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),FIND(" ",A1&" ",MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))-MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))
I think this might be the better solution...

B1: =SUBSTITUTE(A1," "&C1,"")

C1: =TRIM(MID(SUBSTITUTE(MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),500)," ",REPT(" ",500)),1,500))
 
Upvote 0
I am assuming there is a better formula available, but until it is posted, try this...

Assuming your example text is in cell A1, put these formulas in the indicated cells...

B1: =SUBSTITUTE(A1," "&C1,"")

C1: =MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),FIND(" ",A1&" ",MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))-MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))


you are amazing.. I can't believe it.
Can you explain me the logic if i'm not asking too much?
 
Upvote 0
Do not use that formula, rather, use the formula I posted in Message #5... it should be more efficient.

As for explaining the formula, this part calculates the location of the first digit in the text...

MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,074
Messages
6,128,649
Members
449,462
Latest member
Chislobog

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