Home > Topics > excel > body text

How to extract pure numbers from excel cells

青灯夜游
Release: 2021-03-22 16:24:12
Original
32997 people have browsed it

Method: 1. Use the LEFT function to extract numbers from the left and return the specified number of characters; syntax "left(text,num_chars)". 2. Use the MID function to return characters of the specified length from the specified position, the syntax is "MID(text,start_num,num_chars)".

How to extract pure numbers from excel cells

The operating environment of this tutorial: Windows 7 system, Microsoft Office Excel 2007 version, Dell G3 computer.

Open the Excel table that needs to be edited, as shown below:

How to extract pure numbers from excel cells

If the cells contain pure numbers, the method of extracting numbers is relatively simple; for example, To extract the first three digits of the number in cell A2, you can enter the formula in cell B2:

=LEFT(A2,3)
Copy after login

The LEFT function means to extract the number from the left and return the specified number of characters.

How to extract pure numbers from excel cells

If the cell contains a mixture of numbers and letters, the method of extracting numbers will have to change; for example, cell A3 where numbers are to be extracted is If you mix numbers and letters "abc123456", you can use the following formula:

 =MID(A3,4,6)
Copy after login

The MID function means to return characters of the specified length from the specified position.

How to extract pure numbers from excel cells

If the cell contains a mixture of numbers and Chinese characters, one of the ways to extract numbers is to use the MID function; for example, cell A4 to extract numbers is If numbers and Chinese characters are mixed "This month's electricity bill is 128 yuan", you can use the following formula:

 =MID(A4,6,3)
Copy after login

The MID function means to return characters of a specified length from a specified position. Note: A Chinese character is still only counted as 1 digit.

How to extract pure numbers from excel cells

The cell contains a mixture of numbers and Chinese characters. The second way to extract numbers is to find the pattern; for example, in this example, the end is " Yuan", then remove the "yuan" character first:

=LEFT(A4,LEN(A4)-LEN("元"))
Copy after login

How to extract pure numbers from excel cells

Then calculate the digit through 2*LEN(B4)-LENB(B4), and then you can use RIGHT function to get the number in the cell:

=RIGHT(B4,2*LEN(B4)-LENB(B4))
Copy after login

How to extract pure numbers from excel cells

For cell strings that can be converted to numbers followed by numbers, you can use the above formula; for example, cell A5 , you can also use the above method to complete digital extraction.

How to extract pure numbers from excel cells

Related learning recommendations: excel tutorial

The above is the detailed content of How to extract pure numbers from excel cells. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!