+ Reply to Thread
Results 1 to 6 of 6

Find the position of the first nr in a string

  1. #1
    Registered User
    Join Date
    09-08-2014
    Location
    Oslo, Norway
    MS-Off Ver
    2007
    Posts
    4

    Find the position of the first nr in a string

    Hello,

    I tried searching for similar questions without any luck on the forum, hence the reason for making a new thread.

    Question

    Whats the easiest way finding the position of the first nr in a string?

    I have a large data set with area codes where I would like to know the position of the first nr in each cell.

    Ex.
    A2= EASTTRK123 (position would be 8)
    A3 = NORTHOBS332 (Pos would be 9)
    A4: = WESTFRS343
    etc...

    I have been doing some research and found this one to be working; =MIN(FIND({0;1;2;3;4;5;6;7;8;9};A2&"0123456789"))

    Furthermore, I would love if someone could explain the logic behind the formula above.

    Thanks in advance

    Jacob
    Last edited by Jacob2010; 09-08-2014 at 12:13 PM.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Find the position of the first nr in a string

    Here!

    Put this in A2 and Commit using Ctrl+Shift+Enter

    Please Login or Register  to view this content.
    I dont think the formula you have mentioned will work.. Try using a text string without any number..

    Hope it helps..

    Deep
    Last edited by NeedForExcel; 09-08-2014 at 12:08 PM.
    Cheers!
    Deep Dave

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Find the position of the first nr in a string

    Here!

    Put this in A2 and Commit using Ctrl+Shift+Enter

    Please Login or Register  to view this content.
    I dont think the formula you have mentioned will work.. Try using a text string without any number..

    Hope it helps..

    Deep
    Last edited by NeedForExcel; 09-08-2014 at 12:11 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Find the position of the first nr in a string

    nevermind ...
    Last edited by shg; 09-08-2014 at 01:52 PM. Reason: dumb, dumb, dumb.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find the position of the first nr in a string

    shg, I think your formula will return an error unless all 10 digits are in A2.

    This one would work as an arrayed formula
    =MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9}, A2),999))
    Last edited by ChemistB; 09-08-2014 at 01:41 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Find the position of the first nr in a string

    Doh -- I got distracted. Thanks, CB.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Find the position of a substring in a string
    By nemo66ro in forum Excel General
    Replies: 6
    Last Post: 10-22-2012, 01:21 AM
  2. [SOLVED] find nth position of a string
    By TUNGANA KURMA RAJU in forum Excel General
    Replies: 6
    Last Post: 10-18-2005, 09:05 AM
  3. find position of a number in a string
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 11:05 PM
  4. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  5. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1