Forum Discussion

KB7GP's avatar
KB7GP
Copper Contributor
Dec 15, 2019

Finding a number in a text string

I have test strings from 3 to 7 characters, one of which is a number 0-9. The number is not in the same place but may be in the first to third position. How can I have a cell report that number’s position? I will later use that position to parse out the characters Before and after that position. Can this be accomplished without going through each numeral say by using the find() function ten times?

2 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    KB7GP 

    Try this one:

     

    =SUM(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},A1,1),""))

     

    ..... where A1 is your text string.

     

    On drawback though. If your text string has more than one numerical digit in it, it will not work 😞

     

Resources