+ Reply to Thread
Results 1 to 5 of 5

Formula to remove entries after comma

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    14

    Formula to remove entries after comma

    Hi all,

    I was wondering whether there is a formula to remove any other entries in a cell, after comma; see below:

    Col A Col B Col C
    1, 12, 13 1
    0,11, 12 0
    A,B,C A
    D,E,F D


    One way is to do it via Data/ Text to Columns, but in this case you get the after comma entries populated in the cells to the right, is there any formula for the above so that the entries after comma get deleted?

    Thx,
    D
    Last edited by Damian84; 03-16-2012 at 10:56 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to remove entries after comma

    try:

    =LEFT(A1,Find(",",A1)-1)+0
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Formula to remove entries after comma

    populated in the cells to the right
    This can be avoided. In the last screen of the wizard you can select " do not import column"

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to remove entries after comma

    Good point, if indeed all cells contain the same low number of comma separated values. If you have varying number of comma separated values and if there are some cell that contain many, then it becomes a drag to use text to columns... but still probably doable.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to remove entries after comma

    From PM:

    Hi there,

    A few days ago you helped me with the below formula

    LEFT(A1,Find(",",A1)-1)+0

    However, it gives back an error msg, when in one cell I have only one entry (ie there are no myltiple entries, only one, thus no commas). Do you know how to solve this?

    Thank you very much,

    You can use instead: =IF(ISNUMBER(FIND(",",A1)),LEFT(A1,Find(",",A1)-1)+0 ,A1)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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