+ Reply to Thread
Results 1 to 4 of 4

Create a formula to remove last two characters from a cell if the 2nd character is a space

  1. #1
    Registered User
    Join Date
    07-23-2015
    Location
    Lex
    MS-Off Ver
    Kentucky
    Posts
    10

    Create a formula to remove last two characters from a cell if the 2nd character is a space

    Hello, I am working with a data set of over 6,000 rows and am looking for a way to reduce some of the extra unique lines.
    For Example: Some of the lines are exactly the same but end with a " A" or " B" or " 1" or " 2" ect
    Not all lines end with those characters they are just to indicate the same Name has been used multiple times.

    Cat
    Black Dog
    Dog 1
    Cat A
    Frog
    Cat 2
    Cat 3
    Fish
    Black Dog A
    Brown Dog
    Brown Dog C

    Is there a formula that will remove that last two characters if and only the 2nd to last character is a space.
    Thanks,
    Kevin
    Last edited by SellMeTv2; 07-27-2019 at 10:27 PM.

  2. #2
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    195

    Re: Create a formula to remove last two characters from a cell if the 2nd character is a s

    Try,

    =IF(1-ISERR(FIND(" ",RIGHT(A1,2))),LEFT(A1,LEN(A1)-2),A1)

    Regards

  3. #3
    Registered User
    Join Date
    07-23-2015
    Location
    Lex
    MS-Off Ver
    Kentucky
    Posts
    10

    Re: Create a formula to remove last two characters from a cell if the 2nd character is a s

    Thank you, this is exactly what I needed.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Create a formula to remove last two characters from a cell if the 2nd character is a s

    Or this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

+ 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] replace/remove space and character
    By vito01 in forum Excel General
    Replies: 3
    Last Post: 02-11-2019, 02:20 PM
  2. [SOLVED] Remove unknown character and extra space from Name
    By senthile in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-20-2016, 04:06 AM
  3. How to remove space after a particular character
    By sugaprasad in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-20-2015, 05:02 AM
  4. Replies: 0
    Last Post: 08-19-2014, 11:02 AM
  5. Remove Space from first character of text
    By jaymkent in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-19-2012, 07:19 AM
  6. Remove all characters before space in line
    By gartie in forum Excel General
    Replies: 9
    Last Post: 08-29-2012, 05:52 PM
  7. Remove all characters after space
    By vsantoro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2010, 04:46 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