+ Reply to Thread
Results 1 to 10 of 10

finding position of number in text

  1. #1
    Registered User
    Join Date
    07-14-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    32

    finding position of number in text

    hi..izzit possible to find the position of the 1st number value inbetween text??

    example : GBB_5600_OPP_WNN

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: finding position of number in text

    Yes

    =MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&1234567890))

    where A1 holds string

  3. #3
    Registered User
    Join Date
    07-14-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: finding position of number in text

    thank you for the fast reponse! its working fine =)

  4. #4
    Registered User
    Join Date
    07-14-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: finding position of number in text

    hi..sorry..what if the number i want to find is from 5600 and find the position of 5 instead of position of 1 in CA1..how do i avoid that? if methods?

    GBB_CA1_5600_OPP_WNN

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: finding position of number in text

    If we assume the position of interest is where you have _ followed by digit then perhaps something like:

    Please Login or Register  to view this content.
    Not very elegant though... if by any chance you have the morefunc.xll add-in installed you could use a REGEX function to look for the _digit pattern, eg:

    Please Login or Register  to view this content.
    a tad more succinct

  6. #6
    Registered User
    Join Date
    07-14-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: finding position of number in text

    oh ok can! thanks =)

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,257

    Re: finding position of number in text

    You could also use the same principle as the original formula I suppose:
    =MIN(FIND({"_1","_2","_3","_4","_5","_6","_7","_8","_9","_0"},A1&"_1_2_3_4_5_6_7_8_9_0"))+1
    Remember what the dormouse said
    Feed your head

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: finding position of number in text

    you could do but that would be both logical & efficient... so where's the fun in that ?

  9. #9
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,257

    Re: finding position of number in text

    You're right - don't know what came over me!

  10. #10
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: finding position of number in text

    Less is more:

    =MIN(FIND("_"&{1,2,3,4,5,6,7,8,9,0},A1&"_1_2_3_4_5_6_7_8_9_0"))+1

    Even less:

    {=MIN(FIND("_"&ROW(1:9),A1&"_1_2_3_4_5_6_7_8_9_0"))+1}

    Least:

    {=MIN(FIND("_"&ROW(1:9),A1&"_"&ROW(1:9)))+1}
    (though this would be particularly slow in big numbers)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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