+ Reply to Thread
Results 1 to 3 of 3

Eliminate text after fifth comma

Hybrid View

  1. #1
    Registered User
    Join Date
    04-22-2010
    Location
    France
    MS-Off Ver
    Excel 2003
    Posts
    2

    Eliminate text after fifth comma

    Hello forum members,

    Could someone suggest a cell formula-based solution to eliminate any text after the fifth comma (as well as the last comma)?

    I have a column with the following kind of data:

    slgf, dkjs, sjfgsi, deg
    sytfdzau, zeyfd, syfu, dgd, at, syufs, suuf
    sute, stfd, gsid, du, atdd, dggol, yfzq, hg, arut
    ...

    And I would like to get the following result:

    slgf, dkjs, sjfgsi, deg
    sytfdzau, zeyfd, syfu, dgd, at
    sute, stfd, gsid, du, atdd
    ...

    Many thanks!

    AndPia

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Eliminate text after fifth comma

    If the strings are in A1, A2 etc then:

    B1: =LEFT(A1;FIND("@";SUBSTITUTE(A1;",";"@";5)&"@")-1)
    copied down

    (if @ is used within the strings then swap for an alternative character that does not appear within your strings)

  3. #3
    Registered User
    Join Date
    04-22-2010
    Location
    France
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Eliminate text after fifth comma

    Thanks DonkeyOte - quick reply and effective solution. Kudos!

    Best

    AndPia

+ 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