# Excel: How to Find First Number in Text String

You can use the following formulas in Excel to find the first number in a text string:

Formula 1: Return Position of First Number

`=MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"))`

This formula returns the position of the first number in a string.

For example, if the string is A0095B then this formula will return 2 since this is the position in the string where the first number occurs.

Formula 2: Return Value of First Number

`=MID(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")),1)`

This formula returns the value of the first number in a string.

For example, if the string is A0095B then this formula will return 0 since this is the value of the first number that occurs in the string.

The following example shows how to use each formula in practice with the following list of employee ID strings in Excel:

## Example 1: Return Position of First Number

We can type the following formula into cell B2 to return the position of the first number in each Employee ID text string:

`=MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"))`

We can then click and drag this formula down to each remaining cell in column B:

Column B returns the position of the first number in each corresponding string in column A.

For example:

• The first number in A0095B occurs in position 2 of the string.
• The first number in 43387BR occurs in position 1 of the string.
• The first number in BCDD7D occurs in position 5 of the string.

And so on.

## Example 2: Return Value of First Number

We can type the following formula into cell B2 to return the value of the first number in each Employee ID text string:

`=MID(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")),1)`

We can then click and drag this formula down to each remaining cell in column B:

Column B returns the value of the first number in each corresponding string in column A.

For example:

• The value of the first number in A0095B is 0.
• The value of the first number in 43387BR is 4.
• The value of the first number in BCDD7D is 7.

And so on.

The following tutorials explain how to perform other common tasks in Excel:

May 13, 2024
April 25, 2024
April 19, 2024
April 18, 2024
April 18, 2024

## One Reply to “Excel: How to Find First Number in Text String”

1. Elias says:

Thank you for this!! This saved my life.

I want to understand this better/deeper, though.
I know that Find({0,1,2,3,..} creates an array.
I know that A2&”0123456789″ is creating a new value of the value of A2 concatenated with “0123456789”.

My question is, how does the formula KNOW not to return any output when it doesn’t find any numbers in the original A2 cell?
How does it know to return a blank when there are no numbers in the string?
Because when I put =FIND({0,1,2,3,4,5,6,7,8,9},A2&”0123456789″) on a cell that doesn’t have a number, it returns the position of the 0 of the concatenated value.
I want to understand why the formula works so well. I also want to understand why the concatenation with “0123456789” is important and WHY it doesn’t work without it.