+ Reply to Thread
Results 1 to 10 of 10

Find everything after numbers at the start of a string

  1. #1
    Registered User
    Join Date
    09-03-2012
    Location
    Online
    MS-Off Ver
    Excel 2016
    Posts
    48

    Find everything after numbers at the start of a string

    Hi all, I need to identify the qualitative part of a string, and leave the number at the start behind. This may get a little bit more complicated where things have been typed as "1 1/2" for example

    For example

    Original Result
    1 Cup water Cup Water
    1 1/2 Carrots Carrots
    1/2 cup cilantro or 1/2 cup mint leaf cup cilantro or 1/2 cup mint leaf
    1 egg yolk egg yolk

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: Find everything after numbers at the start of a string

    I don't understand this result:

    1/2 cup cilantro or 1/2 cup mint leaf > cup cilantro or 1/2 cup mint leaf

    Why do you not want to remove the second 1/2?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-03-2012
    Location
    Online
    MS-Off Ver
    Excel 2016
    Posts
    48

    Re: Find everything after numbers at the start of a string

    In this instance it would be fine to remove the second 1/2.
    There may be others where it may not be ok to remove the second number. Eg 2 carrots cut in 1/2

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find everything after numbers at the start of a string

    There a differant approaches.

    This is one of them

    a1=RIGHT(A1,LEN(A1)-SEARCH(" ",A1,1))
    Last edited by oeldere; 08-29-2016 at 03:18 AM. Reason: changed FIND into Search
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: Find everything after numbers at the start of a string

    Quote Originally Posted by oeldere View Post
    =RIGHT(A1,LEN(A1)-FIND(" ",A1,1))
    This only removes everything up to and including the first space character.

    There may be others where it may not be ok to remove the second number. Eg 2 carrots cut in 1/2
    Which makes it awkward, as I would not know an unnecessary 1/2 from a necessary one.

    Presumably these strings can start with numbers other than 1?

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find everything after numbers at the start of a string

    I changed the formula from Find into Search (translationproblem)

    a1=RIGHT(A1,LEN(A1)-SEARCH(" ",A1,1))


    Which makes it awkward, as I would not know an unnecessary 1/2 from a necessary one.
    @AliGW Off course that is a good point, but for now the OP was satisfied with this one.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: Find everything after numbers at the start of a string

    Quote Originally Posted by oeldere View Post
    =RIGHT(A1,LEN(A1)-SEARCH(" ",A1,1))
    Which has the same result - it only removes everything up to and including the first space, so if you have 1 1/2 carrots you end up with 1/2 carrots.

    Quote Originally Posted by oeldere View Post
    @AliGW Off course that is a good point, but for now the OP was satisfied with this one.
    Do you mean satisfied with leaving the second 1/2 in the middle of the text string? If so, then yes, I agree. If you are saying that the OP is satisfied with your formula, then I wonder why, for the reason stated above.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find everything after numbers at the start of a string

    Do you mean satisfied with leaving the second 1/2 in the middle of the text string? If so, then yes, I agree.
    of course it is this one.

  9. #9
    Registered User
    Join Date
    09-03-2012
    Location
    Online
    MS-Off Ver
    Excel 2016
    Posts
    48

    Re: Find everything after numbers at the start of a string

    Thanks for the feedback all.

    So the formula supplied doesn't appear to work with the example of "1 1/2 Carrots" as it will just pick all after the first space.

    As it turns out my data set needs a huge amount of work as there are random spaces in some examples I didn't supply. Eg 4 -5 carrots. The formula supplied will get me much of the way there, however, so thank you for that.

  10. #10
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Find everything after numbers at the start of a string

    Try this ...

    =REPLACE(A1,1,MIN(IFERROR(SEARCH(CHAR(ROW($97:$122)),A1),""))-1,"")

    Enter with Ctrl+Shift+Enter.

+ 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. Formulas to return numbers from start and end of a string
    By Motox in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 08-12-2016, 03:27 AM
  2. Replies: 3
    Last Post: 05-19-2016, 06:21 PM
  3. Replies: 1
    Last Post: 08-07-2015, 04:01 PM
  4. [SOLVED] FIND with RIGHT to return numbers from a string
    By jndipworm in forum Excel General
    Replies: 6
    Last Post: 03-26-2015, 09:34 AM
  5. [SOLVED] Find and replace 61 at the start of numbers but not within
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-19-2014, 08:00 AM
  6. Find most common (x5) numbers within numerical string range
    By JEWB in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-03-2014, 06:59 AM
  7. Excel 2007 : find duplicate numbers in string
    By ozbrian in forum Excel General
    Replies: 8
    Last Post: 11-01-2011, 12:37 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