+ Reply to Thread
Results 1 to 5 of 5

Removing last character of CELL if it's a (number / space / comma)

  1. #1
    Registered User
    Join Date
    01-19-2021
    Location
    Germany
    MS-Off Ver
    Microsoft Office for Mac
    Posts
    2

    Removing last character of CELL if it's a (number / space / comma)

    Dear Excel community,

    I'm facing a problem which I can't solve after trying a lot of different options. I attached an excel file as an example.

    Following is the problem:

    I'm using a column with in each cell a product description including some article numbers. I now want to remove all these article numbers since they're outdated.

    For example:


    This is a product description, for product A

    4353434323, 42354252435, 324325432, 56003324, 3445435
    This is a product description, for product B

    723487234, 443563214


    I need to have these article numbers removed, the problem is, some descriptions have 2 article numbers, some 4 or some even more than 10.

    So my logic would be something like: Remove last character if it's equal to a number / space / comma. In that way it would strip out everything except the description itself. I thought in this direction: =IF(RIGHT(A1,1)=" ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ",",LEFT(A1,LEN(A1)-1),A1) but that obviously doesn't work.

    In the example file is some test data (5 in total) in reality we're talking about more than 2000+ descriptions. So deleting by hand wasn't my first choice as you probably can imagine.

    I'm probably overthinking once again. Could you help me?

    Many thanks in advance.

    Accorda
    Attached Files Attached Files

  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,929

    Re: Removing last character of CELL if it's a (number / space / comma)

    Welcome to the forum.

    Based on your sample, try this:

    =LEFT(A1,FIND(CHAR(10),A1)-1)

    or this for your locale:

    =LEFT(A1;FIND(CHAR(10);A1)-1)

    It uses the carriage return as the separator.
    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
    01-19-2021
    Location
    Germany
    MS-Off Ver
    Microsoft Office for Mac
    Posts
    2

    Re: Removing last character of CELL if it's a (number / space / comma)

    Dear AliGW,

    That seems to work perfectly! I would have never thought that it could be solved with such a short formula.

    Many thanks!!

    Have a great day, thread can be set to SOLVED.

    Kind regards,

    Accorda

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Removing last character of CELL if it's a (number / space / comma)

    In case, there are more than 1 space (char (10)) in A1, and no number within description:

    Please Login or Register  to view this content.
    Quang PT

  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,929

    Re: Removing last character of CELL if it's a (number / space / comma)

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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] Comma Then Space After Each Number In Cell
    By fredfarmer in forum Excel General
    Replies: 3
    Last Post: 04-18-2019, 12:29 PM
  2. [SOLVED] QUICK HELP WITH removing space and comma
    By mecutemecute in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2013, 09:35 AM
  3. [SOLVED] extraction of number from cell containing alpha-numeric character with space
    By Astaa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-14-2013, 02:31 AM
  4. Replies: 7
    Last Post: 02-10-2013, 02:10 AM
  5. Removing chars not (a-z,1-9,space,comma,period)
    By jartzh in forum Excel General
    Replies: 2
    Last Post: 12-17-2009, 05:25 PM
  6. Replies: 7
    Last Post: 04-12-2006, 11:00 PM
  7. Removing a space after a comma
    By DebbieK9 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-01-2005, 06:06 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