Extracting numbers from Excel Cell

wooly_sohail

New Member
Joined
Jul 28, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Extracting all numbers from single cell and separating each of them by ":"
Ex:- If a cell has

$85.5_Michigan
$89_Illinois
Kentucky_$82
Missouri_$65
Ohio_$194; Tennessee; 256; Kansas; Florida; California; Ottawa; Waterloo; Ontario


I would like to have 85.5;89;82;65;194;256 as output in a single excel cell.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
For that example, how about
Fluff.xlsm
AB
1
2$85.5_Michigan $89_Illinois Kentucky_$82 Missouri_$65 Ohio_$194; Tennessee; 256; Kansas; Florida; California; Ottawa; Waterloo; Ontario85.5;89;82;65;194;256
Report
Cell Formulas
RangeFormula
B2B2=TEXTJOIN(";",,FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"$",""),CHAR(10)," "),"_"," "),";"," ")," ","</m><m>")&"</m></k>","//m[.=number()]"))
 
Upvote 0
Solution
I think this should do it for you too & you don't need to specify all the 'extra' characters that you don't want.
It does assume that the only "." characters will be within numbers as per your one example.

22 07 29.xlsm
AB
1
2$85.5_Michigan $89_Illinois Kentucky_$82 Missouri_$65 Ohio_$194; Tennessee; 256; Kansas; Florida; California; Ottawa; Waterloo; Ontario85.5;89;82;65;194;256
Extract nums
Cell Formulas
RangeFormula
B2B2=LET(ch,MID(A2,SEQUENCE(LEN(A2)),1),SUBSTITUTE(TRIM(CONCAT(IF(ISNUMBER(ch+0)+(ch="."),ch," ")))," ",";"))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,487
Messages
6,125,073
Members
449,205
Latest member
Healthydogs

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