Excel How to extract numbers from text in cell

HelenL

New Member
Joined
Nov 17, 2008
Messages
30
Can anyone tell me please how to extract numbers from text in a cell. Example Andrew, 20055, Keith where the number in the middle is sometimes 2, 3, 4, 5 or 6 in length? thanks
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Welcome to the board...

Try

=LEFT(MID(A1,FIND(" ",A1)+1,LEN(A1)),FIND(",",MID(A1,FIND(" ",A1)+1,LEN(A1)))-1)

I'm sure there's a better way though...
 
Upvote 0
Assuming that the format is consistent (number or numbers are between two commas), try...

=TRIM(MID(A2,FIND(",",A2)+1,FIND(",",A2,FIND(",",A2)+1)-FIND(",",A2)-1))
 
Upvote 0
Thank you so much. I'm afraid I didn't explain properly. I need to remove the numbers to leave the name Example Andrew, 20055, Keith to become Andrew Keith
Any suggestions please?
 
Upvote 0
Then perhaps..

=LEFT(A1,FIND(",",A1)-1)&MID(A1,FIND(" ",A1,FIND(" ",A1)+1),LEN(A1))
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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