Excel formula to extract numbers from text

Lee733

New Member
Joined
Jan 22, 2018
Messages
25
Office Version
  1. 365
Platform
  1. Windows
I couldn't get these formulas to work:

[TABLE="width: 576"]
<tbody>[TR]
[TD="colspan: 5"]=MIN(FIND({0,1,2,3,4,5,6,7,8,9},A4&"0123456789"))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 6"]=MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A5&"0123456789"))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 9"]=RIGHT(A6,SUM(LEN(A6)-LEN(SUBSTITUE(A6,{"0","1","2","3","4","5","6","7","8","9"},""))))[/TD]
[/TR]
</tbody>[/TABLE]


Data starting in A4:

[TABLE="width: 296"]
<tbody>[TR]
[TD]Agnes Twp, Fordville SD, Niag Fire - 0104-8[/TD]
[/TR]
[TR]
[TD]Agnes Twp, Fordville SD, Ink Fire - 0104-09[/TD]
[/TR]
[TR]
[TD]Agnes Twp, Larimore SD - 0107[/TD]
[/TR]
</tbody>[/TABLE]


I would like a formula that would return

0104-8
0104-9
0107

Any idea what I am doing wrong?
 
I tried changing to a semi-colon, and that did not work.
Even for the formula I posted?

=TRIM(RIGHT(SUBSTITUTE(A4;" ";REPT(" ";200));200))

What error did you get when you tried this?
 
Last edited:
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Thank you for all your help. You and Rick are amazing! Debbie
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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