+ Reply to Thread
Results 1 to 9 of 9

Trim-off all data before 3rd occurrence of a symbol..

  1. #1
    Registered User
    Join Date
    02-07-2012
    Location
    LA
    MS-Off Ver
    Excel For Mac 2011
    Posts
    99

    Trim-off all data before 3rd occurrence of a symbol..

    Hi ,
    I'm trying to capture the last part of the data and trim-off everything before the 3rd occurrence of the "_" . (i.e- I'm wanting to keep the "Henry" & "Sam" parts of the metadata). Any help would be much appreciated

    Data:

    ZV163_01_RogueWaves_Henry
    ZV178_23_RedDawn_Sam

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Trim-off all data before 3rd occurrence of a symbol..

    non VBA solution

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    essentially

    find the 3rd occurrence of _ and replace with blank space (char 1)
    then mid formula to start from this point + 1
    extend 50 if you require longer names? or smaller if you dont require so much space
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,606

    Re: Trim-off all data before 3rd occurrence of a symbol..

    never mind
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    02-07-2012
    Location
    LA
    MS-Off Ver
    Excel For Mac 2011
    Posts
    99

    Re: Trim-off all data before 3rd occurrence of a symbol..

    Thanks humdingaling , but I'm going to have to do this on thousands of rows with varying data, so I don't know how I'd turn the 3rd occurrence into a space on all of them

    I know a basic find and trim formula [ =TRIM(RIGHT(A1,FIND("_",A1))) ] , but I'm thinking there must be a way to make one that will work by finding the 3rd occurrence and then just fill it down the sheet

  5. #5
    Registered User
    Join Date
    02-07-2012
    Location
    LA
    MS-Off Ver
    Excel For Mac 2011
    Posts
    99

    Re: Trim-off all data before 3rd occurrence of a symbol..

    I figured it out. This one is working :

    =TRIM(RIGHT(SUBSTITUTE(A2,"_",REPT(" ",999)),999))

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Trim-off all data before 3rd occurrence of a symbol..


    the formula i provided automatically did what i was explaining without the trim
    As i was not aware of your full data set
    your conditions was 3rd occurrence as i don't know if you may have 4th of 5th in your data set
    hence why i used Mid instead of right =)

    your formula works by "stretching" the last occurrence out to the point the text after 3rd _ is "separated" from the rest of the text
    you probably do not need 999 spaces.....100 should be more than suffice
    will make your sheet run better
    however if there is a 4th occurence of _ your formula will fail

    either way as long as it works for you

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,606

    Re: Trim-off all data before 3rd occurrence of a symbol..

    or,

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-07-2012
    Location
    LA
    MS-Off Ver
    Excel For Mac 2011
    Posts
    99

    Re: Trim-off all data before 3rd occurrence of a symbol..

    I'm sorry humdingaling , I implemented it incorrectly somehow.. The one you made totally works great! As does yours protonLeah. Thank you both !

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Trim-off all data before 3rd occurrence of a symbol..

    not a problem

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Cheers
    hum

+ 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] Remove first occurrence of data in a column....help please!
    By mnfez in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-10-2014, 06:23 PM
  2. Multiple occurrence => 1 occurrence
    By exhortae in forum Excel General
    Replies: 4
    Last Post: 09-08-2010, 05:00 AM
  3. Concatenate Text and Trim Symbol
    By seanyeap in forum Excel General
    Replies: 24
    Last Post: 04-08-2010, 09:40 PM
  4. Replies: 4
    Last Post: 03-15-2010, 09:57 AM
  5. Trying to trim a trailing space char and the Trim function isn't working
    By Psychochook in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2007, 11:28 PM

Tags for this Thread

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