+ Reply to Thread
Results 1 to 6 of 6

Find and Delete XX characters from Right

  1. #1
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Find and Delete XX characters from Right

    I have a column of names/text where I need to search and find a " - " minus symbol from the right, and then delete that symbol and all text to the right of that as well.

    The minus symbol will exist more then once in the Cell, thus need to search for it from the right. Currently this data is in column G.


    Can anyone help with that this morning?

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,281

    Re: Find and Delete XX characters from Right

    Hi ptmuldoon,

    What if you replaced all "-" characters in your string to "-"& "100 spaces". Then delete the last 100 characters from this new string. NOW - the trick is that if you TRIM() the string it will reduce all those extra spaces to a single space. This would be my approach. If you give us a few sample strings, we might build a formula for you.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Find and Delete XX characters from Right

    hi ptmuldoon. try:
    =LEFT(A1,FIND("^",SUBSTITUTE(A1,"-","^",LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))))-1)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Valued Forum Contributor
    Join Date
    12-01-2016
    Location
    Planet Earth
    MS-Off Ver
    95 - 2016
    Posts
    343

    Re: Find and Delete XX characters from Right

    This will delete everything to the right of the "-": =LEFT(A1,LEN(A1)-FIND("-",A1))
    This will delete everything to the left of the "-": =RIGHT(A1,LEN(A1)-FIND("-",A1))

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find and Delete XX characters from Right

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 09-12-2017 at 10:27 AM.

  6. #6
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Find and Delete XX characters from Right

    Guys,

    Sorry for the delays in the response. Brutal work/files this week to analyze. But both macro and formula's above all work well. Now I can least pivot and do some analysis on customer names.

    As an example, I was dealing with "CustomerName - New York", "CustomerName - Chicago", etc. Now I've eliminated the cities, etc. to get a common name.

+ 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] How to delete the two last characters if its an *+?
    By dewonw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-06-2016, 04:19 PM
  2. Find characters in a cell containing characters and numbers
    By T86157 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-02-2016, 08:21 PM
  3. [SOLVED] Macro to delete characters between 2 characters.
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-29-2014, 08:48 AM
  4. [SOLVED] Delete first 2 characters characters
    By jhalsall80 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-30-2014, 11:36 AM
  5. [SOLVED] Delete characters and add * in front and last characters in ACCESS QUERY
    By LALTIZER in forum Access Tables & Databases
    Replies: 9
    Last Post: 02-01-2013, 02:06 PM
  6. [SOLVED] Characters.delete only works with less than 255 characters?
    By mexindian in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-26-2012, 11:57 AM
  7. [SOLVED] In Excel find characters when multiple characters exist w/i a cel
    By teacher-deburg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2005, 06:25 PM

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