How to find position of first/last number in a text string in Excel?
For example, you have a list of text string which is a mixture of letters and numbers. If you want to find the position of the first or last number in each string, what would you do? Actually, using formula will help you quickly find the position of first/last number in a specified text string. In this tutorial, we will show you the details of dealing with this problem.
Find position of first number in text string in Excel
Find position of last number in text string in Excel
Find position of first number in text string in Excel
As the below screenshot shown, for finding positions of first numbers in the text strings, please do as follows.
1. Select the cell B2, copy and paste one of the below formula into the Formula Bar:
1). Formula 1: =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"));
2). Formula 2: =MATCH(TRUE,ABS(CODE(MID(A2,ROW($A$1:INDEX(A:A,LEN(A2))),1))-52.5)<5,0) + Ctrl + Shift + Enter;
3). Formula 3: =MIN(IF(ISERROR(FIND({1;2;3;4;5;6;7;8;9;0},A2)),"",FIND({1;2;3;4;5;6;7;8;9;0},A2))).
2. Then the first number position of the first string is displaying in the cell B2. Now drag the Fill Handle down to cell B7 to fill the below range.
Then all first number positions of the whole strings are listed out.
Find position of last number in text string in Excel
After finding the position of first number, we now start finding the position of last number in strings.
In this section, there are two formulas for you.
Formula 1: =MAX(IF(ISNUMBER(VALUE(MID(A2,ROW(INDIRECT("1:" & LEN(A2))),1))),ROW(INDIRECT("1:" & LEN(A2))))) + Ctrl + Shift + Enter;
Formula 2: =MAX(IFERROR(FIND({1,2,3,4,5,6,7,8,9,0},A2,ROW(INDIRECT("1:"&LEN(A2)))),0)) + Ctrl + Shift + Enter
1. Select cell B2, copy and paste one of the above formulas into the Formula Bar, then press Ctrl + Shift + Enter keys simultaneously. Then you can see the result displays in B2.
2. Select the B2, drag the Fill Handle down to cell B7 to auto fill the range.
Then you will get positions of all last numbers of the whole text string immediately.
Easily separate text and number from one cell into two columns in Excel:
With Kutools for Excel’s Split Cells utility, you can split a range of cells into rows or columns by specific separator, split text and numbers or split text by certian length. Download and try it now! (30-day free trail)
Related articles:
- How to find first blank cells in column in Excel?
- How to find cells with/having conditional formatting in Excel?
- How to find cells with/having data validation in Excel?
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
- Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
- Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
- Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
- Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
- Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
- Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
- Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
- Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
- More than 300 powerful features. Supports Office / Excel 2007-2021 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.

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!















