How to extract decimal numbers from text string in Excel?
Suppose there are text strings containing decimal numbers in your worksheet; how can you quickly and easily extract only the decimal numbers? In this article, I will talk about some handy tricks to solve this problem for you in Excel.
Extract decimal numbers from text string with formulas
Extract numbers only from text string with Kutools for Excel
Extract decimal numbers from text string with formulas
Here are some long formulas for you to extract decimal numbers from cells, please do as follows:
1. Enter this formula into a blank cell where you want to output the result: =LOOKUP(9.9E+307,--LEFT(MID(A2,MIN(FIND({1,2,3,4,5,6,7,8,9,0}, $A2&"1023456789")),999),ROW(INDIRECT("1:999")))), and then press Enter key to extract the decimal numbers, see screenshot:
2. And then select the cell C2, and drag the fill handle down to the cells that you want to contain this formula, all the decimal numbers have been extracted from the text strings, see screenshot:
Notes:
1. If there is more than one number within a cell, with the above formula, only the first number will be extracted.
2. Except the first normal formula, here is another array formula: =--MID(A2,MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9,".",","},A2),"")),COUNT(--MID(SUBSTITUTE(SUBSTITUTE(A2,".",0),",",0),ROW($1:$99),1))), and then remember to press Ctrl + Shift + Enter keys together to get the correct result. If there is more than one number within a cell, after applying this formula, an error value will be displayed.
3. These formulas also can extract the whole numbers as well.
Extract numbers only from text string with Kutools for Excel
If you have Kutools for Excel, with its Extractnumbers function, you can quickly extract numbers only from text strings without remembering any formulas.
1. Click a cell where you want to locate the extracted number.
2. Then click Kutools > Kutools Functions > Text > EXTRACTNUMBERS, see screenshot:
3. In the Function Arguments dialog box, click button besides TXT to select a cell that you want to extract number from, and then enter true or false into the N text box as you need, (True will return the numeric number, and False will return the text format.) see screenshot:
4. Then click OK button, the number is displayed in the selected cell, and then you can select the cell and drag the fill handle down to the cells which you want to apply this function, all numbers have been extracted at once, see screenshot:
Notes:
1. If there is more than one number within a cell, all numbers will be extracted together.
2. This function is only applied to extracting the whole number.
Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!