Regextract formula to extract numbers

pto160

Well-known Member
Joined
Feb 1, 2009
Messages
505
Office Version
  1. 365
Platform
  1. Windows
I have Excel 365. They just added the REGEXTRACT formula to my Excel. I am using the formula to extract numbers. Is there a way to extract all numbers from a text string, not just the first group of numbers?

Book1
ABC
1What I am gettingWhat I like
2456ER456456
3123ER98Z8123123988
4ZC45RT3A1454531
Sheet1
Cell Formulas
RangeFormula
B2:B4B2=REGEXEXTRACT(A2,"\d+")
 
How about:

Excel Formula:
=TEXTJOIN("",TRUE,TEXTSPLIT(REGEXREPLACE(A2, "[^\d]+", "|"), "|"))
 
Upvote 0
Another option
Excel Formula:
=CONCAT(REGEXEXTRACT(A3,"\d+",1))
 
Upvote 0
Thank you so much everyone. These formulas work great. :) (y)
 
Upvote 0
Glad we could help & thank for the feedback.
 
Upvote 0
Thank you so much Peter_SSs. This works great. (y) :) This will save me a lot of time.
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,226,835
Messages
6,193,227
Members
453,781
Latest member
Buzby

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