+ Reply to Thread
Results 1 to 5 of 5

Specific sorting question involving commas

  1. #1
    Registered User
    Join Date
    06-23-2009
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Specific sorting question involving commas

    I've been trying to come up with a way to sort some data but don't know the formula i'm looking for. Here is the what i'm aiming for...

    Say i have the cell: Edison Mission Energy, 7.50%, 06/15/13

    Is there a way I can get excel to output everything before the comma, so the result would be "Edison Mission Energy"

    I know it sounds basic but it would def help me. Thanks,

    Geoff

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Specific sorting question involving commas

    =LEFT(A1,FIND(",",A1)-1) will do that
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    06-23-2009
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Specific sorting question involving commas

    That will partially work. The only problem with that formula is that it leaves my output as "NA" if the cell has no comma. Is there a way to expand it so that if it doesn't have a comma it displays the orginal cell?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Specific sorting question involving commas

    The easy way is to use conditional formatting to mask display of #N/A
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Specific sorting question involving commas

    =if(iserror(find(",",a1)),a1,(left(a1,find(",",a1)-1)))

+ 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