+ Reply to Thread
Results 1 to 3 of 3

The first instance of a number in a string

  1. #1
    Registered User
    Join Date
    05-21-2008
    Posts
    24

    The first instance of a number in a string

    I have some text, such as this:

    PD91-A-1000-1_R1D

    How can I find the first instance of a number after the "_"? I want Excel to find the "1" after the "_" and cut it to the end resulting in "1D".

    I hope that makes sense.

    Thanks!

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    I assume you can't do something as simple as

    =RIGHT(A1,2)

    To return all the data from the first digit after the underscore try

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

  3. #3
    Registered User
    Join Date
    05-21-2008
    Posts
    24
    Unfortunately life is not as simple as =RIGHT(A1,2). I need to make this formula universal and the text after the "_" will vary in character length etc... The other formula you posted is what I am looking for though.

    Thank you very much!

+ 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