+ Reply to Thread
Results 1 to 10 of 10

Return the list of marked cells

Hybrid View

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Unhappy Return the list of marked cells

    Hi!

    Please help me with the following problem:

    I have a range of cells that are marked by me, such as

    A ; Football
    A ; Football
    A ; Basketball
    A ; Tennis
    B ; Swimming
    B ; Swimming
    B ; Running
    A ; Climbing
    A ; Tennis
    B ; Baking
    B ; Swimming

    What i want is to have a list of A's and B's, such as:

    Football
    Football
    Basketball
    Tennis
    Tennis
    Climbing
    Tennis

    and a second list

    Swimming
    Swimming
    Running
    Baking
    Swimming

    Can't handle that, tried indexing and such things, but I'm not an excel pro so any help would be appreciated
    Last edited by kissmydrone; 11-07-2012 at 07:59 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,239

    Re: Return the list of marked cells

    Marked in what way? Return to where? Why not just use Autofilter. There's no real reason to put the data anywhere else.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-07-2012
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Return the list of marked cells

    TMS,

    The first columnd is the mark - A or B, the second column are the "activities".
    They should be returned in a new sheet within the same file.
    Basically, ive got lots of cells and i need them to be sorted and split automatically.

  4. #4
    Registered User
    Join Date
    11-07-2012
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Return the list of marked cells

    example.xlsx

    Ok basically I want the file to look like the one in the file

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,239

    Re: Return the list of marked cells

    For 1: Array Formula:

    =IFERROR(INDEX(B$2:B$100,SMALL(IF($A$2:$A$100=1,ROW(A$2:A$100)-ROW(A$2)+1),ROWS(A$2:A2))),"")

    Committed with Ctrl-Shift Enter rather than just Enter (will show as {...}



    Regards, TMS

  6. #6
    Registered User
    Join Date
    11-07-2012
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Return the list of marked cells

    Brilliant, works great !

    Thank You very much !

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return the list of marked cells

    My suggestion.Also Array formula.

    =IFERROR(INDEX(Sheet1!$B$2:$B$100,SMALL(IF(Sheet1!$A$2:$A$100=1,ROW(Sheet1!$B$2:$B$100)-1),ROW(Sheet1!A1))),"")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,239

    Re: Return the list of marked cells

    You're welcome. Thanks for the rep.

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return the list of marked cells

    TMS,your formula gives me 0(that's why i post another suggestion).

    Any idea why?

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,239

    Re: Return the list of marked cells

    @Fotis: not really. It's a formula I found, copied and adapted. It worked for the 1 marker but not the 0 marker. The reason being that the 1 was numeric and the 0 was text (we how it is left aligned. I remedied that in my test by using"0" rather than just 0 in the IF statement.

    I haven't tried your version yet; it may well be a superior option.

    Regards, TMS

+ 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