ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   find position of a number in a string (https://www.excelbanter.com/excel-worksheet-functions/44020-find-position-number-string.html)

fullers80

find position of a number in a string
 
How do I find the first occurrence of a number in a string? I have a list of
postcodes that will obviously have different digits.
I want to go from using many FIND functions e.g.,

=FIND(0,A1), then =FIND(1,A2) etc...

to

=FIND(0-9,A1)

what text would I need to put in to replace the "0-9"?

Thanks

Dave Peterson

One way:

=MATCH(TRUE,ISNUMBER(-MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),0)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

fullers80 wrote:

How do I find the first occurrence of a number in a string? I have a list of
postcodes that will obviously have different digits.
I want to go from using many FIND functions e.g.,

=FIND(0,A1), then =FIND(1,A2) etc...

to

=FIND(0-9,A1)

what text would I need to put in to replace the "0-9"?

Thanks


--

Dave Peterson


All times are GMT +1. The time now is 11:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com