# How to Extract numbers from an Excel cell?

Last Updated on 18/05/2023
Reading time: 2 minutes

How to extract only the digits from an Excel cell containing numbers and letters. To do that, we will use the new Excel functions: FILTER and SEQUENCE.

## What is the logic used to do the job?

To extract only the number from an Excel cell, we must split each character and keep the numbers.

1. This work is made possible thanks to the new SEQUENCE function and the STXT function.
2. Next, we will perform a test to find out if each of these characters is a number or not.
3. Finally, when the test is true, we keep only the numbers.

## Step 1: Extract each character from the cell

The MID function allows you to extract a sub-part of a character string. Associated with the SEQUENCE function, you create an array in which each cell will represent one of the characters in the cell.

=MID(A2,SEQUENCE(,LEN(A2)),1)

## Step 2: Test to know if the content is a number or not

Next, we need to perform a test on each of the cells to find out if the content is numeric or not.

So, of course, here, using the ISNUMBER function seems logical. However, at this stage, each of the cells contains the text.

=ISNUMBER(MID(A2,SEQUENCE(,LEN(A2)),1))

We must, therefore, first convert each of the cells to a numerical value, if necessary. Thanks to the VALUE function, this conversion is automatic. The formula becomes.

=ISNUMBER(VALUE(MID(A2,SEQUENCE(,LEN(A2)),1)))

## Step 3: Keep only the numbers

To extract only the list of numbers, we will use the FILTER function. FILTER returns the rows when the test is true.

=FILTER(VALUE(MID(A2,SEQUENCE(,LEN(A2)),1)),ISNUMBER(VALUE(MID(A2,SEQUENCE(,LEN(A2)),1))))

## Step 4: Group the numbers together

Finally, the result of the FILTER expression will be embedded in a TEXTJOIN function

=TEXTJOIN("",,FILTER(MID(A8,SEQUENCE(LEN(A8)),1),NOT(ISNUMBER(VALUE(MID(A8,SEQUENCE(LEN(A8)),1))))))

## Frédéric LE GUEN

#### 1 Comment

1. Rick Rothstein
29/03/2023 @ 06:54

Here is another formula that will retrieve the digits from a text string...

=CONCAT(IFERROR(0+MID(A2,SEQUENCE(LEN(A2)),1),""))

# How to Extract numbers from an Excel cell?

Reading time: 2 minutes
Last Updated on 18/05/2023

How to extract only the digits from an Excel cell containing numbers and letters. To do that, we will use the new Excel functions: FILTER and SEQUENCE.

## What is the logic used to do the job?

To extract only the number from an Excel cell, we must split each character and keep the numbers.

1. This work is made possible thanks to the new SEQUENCE function and the STXT function.
2. Next, we will perform a test to find out if each of these characters is a number or not.
3. Finally, when the test is true, we keep only the numbers.

## Step 1: Extract each character from the cell

The MID function allows you to extract a sub-part of a character string. Associated with the SEQUENCE function, you create an array in which each cell will represent one of the characters in the cell.

=MID(A2,SEQUENCE(,LEN(A2)),1)

## Step 2: Test to know if the content is a number or not

Next, we need to perform a test on each of the cells to find out if the content is numeric or not.

So, of course, here, using the ISNUMBER function seems logical. However, at this stage, each of the cells contains the text.

=ISNUMBER(MID(A2,SEQUENCE(,LEN(A2)),1))

We must, therefore, first convert each of the cells to a numerical value, if necessary. Thanks to the VALUE function, this conversion is automatic. The formula becomes.

=ISNUMBER(VALUE(MID(A2,SEQUENCE(,LEN(A2)),1)))

## Step 3: Keep only the numbers

To extract only the list of numbers, we will use the FILTER function. FILTER returns the rows when the test is true.

=FILTER(VALUE(MID(A2,SEQUENCE(,LEN(A2)),1)),ISNUMBER(VALUE(MID(A2,SEQUENCE(,LEN(A2)),1))))

## Step 4: Group the numbers together

Finally, the result of the FILTER expression will be embedded in a TEXTJOIN function

=TEXTJOIN("",,FILTER(MID(A8,SEQUENCE(LEN(A8)),1),NOT(ISNUMBER(VALUE(MID(A8,SEQUENCE(LEN(A8)),1))))))

#### 1 Comment

1. Rick Rothstein
29/03/2023 @ 06:54

Here is another formula that will retrieve the digits from a text string...

=CONCAT(IFERROR(0+MID(A2,SEQUENCE(LEN(A2)),1),""))

{"mobile_concate":{"mobile-menu":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/mobile-menu.css"},"tf_base":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/css\/base.min.css","v":"7.6.0"},"themify_common":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/css\/themify-common.css","v":"7.6.0"},"builder-styles-css":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/themify-builder\/css\/themify-builder-style.css","v":"7.6.0"},"tb_tbp":{"s":"https:\/\/excel-tutorial.com\/wp-content\/plugins\/themify-builder-pro\/public\/css\/tbp-style.css","v":"3.5.9"},"tf_theme_site-logo":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/styles\/modules\/site-logo.css","v":"7.5.5"},"tf_search_form":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/css\/modules\/search-form.css","v":"7.6.0"},"tb_featured-image":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/themify-builder\/css\/modules\/image.css","v":"7.6.0"},"tb_divider":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/themify-builder\/css\/modules\/divider.css","v":"7.6.0"},"tb_post-content":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/themify-builder\/css\/modules\/text.css","v":"7.6.0"},"wp-block-library":{"s":"https:\/\/excel-tutorial.com\/wp-includes\/css\/dist\/block-library\/style.min.css","v":"6.5.2"},"tb_comments":{"s":"https:\/\/excel-tutorial.com\/wp-content\/plugins\/themify-builder-pro\/public\/css\/modules\/comments.css","v":"3.5.9"},"tb_image":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/themify-builder\/css\/modules\/image.css","v":"7.6.0"},"tb_app":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/themify-builder\/css\/modules\/appearance.css","v":"7.6.0"},"tb_image_top":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/themify-builder\/css\/modules\/image_styles\/top.css","v":"7.6.0"},"tb_text":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/themify\/themify-builder\/css\/modules\/text.css","v":"7.6.0"},"theme-style":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/style.css","v":"7.5.5"},"themify-media-queries":{"s":"https:\/\/excel-tutorial.com\/wp-content\/themes\/themify-infinite\/media-queries.css","v":"7.5.5","m":"(max-width:1200px)"}}