+ Reply to Thread
Results 1 to 5 of 5

Help with "Sorting" formula?

Hybrid View

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help with "Sorting" formula?

    Hi All,

    First time posting here, and am hoping the experts here would be able to lend a hand!

    I've included a copy of what the data "sort of" looks like, and what the desired output is.

    Pretty much I have Data that sorts people based on gender and position.

    The thought would be to "Sort" them into a new table based on their gender/position.

    So if it was
    Employee A, Male, Waiter
    Employee B, Female, Waiter
    Employee C, Male, Cook
    Employee, D, Female, Cook
    Employee E, Female, Waiter

    My result set would look like:

    Male Waiters:
    Male Waiters Male Cooks female Waiters female Cooks
    Employee A Employee B Employee C Employee D
    Employee E

    It seems simple enough but can't seem to get any forumla to work. Would anyone be able to lend a hand? :P

    Much appreciated!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-03-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Help with "Sorting" formula?

    Pivot Table Book 1 CTSUI7.xlsx

    Would a pivot table work here? I don't know if you're looking for something formula driven so that you can further manipulate the data, but if it's just straight sorting into another table, I think pivot tables work pretty well. See attached.

  3. #3
    Registered User
    Join Date
    06-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help with "Sorting" formula?

    Thanks Ditto,

    I think the Pivot would be closer to a "last" step.

    I think Ideally if I can get some sort of formulaic solution that would be most preferable

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Help with "Sorting" formula?

    maybe array formula -ctrl+shift+enter

    Formula: copy to clipboard
    =IFERROR(INDEX($D$2:$D$11,SMALL(IF($C$2:$C$11="Waiter",IF($B$2:$B$11="m",ROW($D$2:$D$11)-ROW($D$2)+1)),ROWS($A$1:$A1))),"")
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Help with "Sorting" formula?

    Try this...

    Enter these column headers:

    F1:I1 = M, M, F, F
    F2:I2 = Waiter, Cook, Waiter, Cook

    Enter this array formula** in F3:

    =IFERROR(INDEX($D:$D,SMALL(IF($B$2:$B$11=F$1,IF($C$2:$C$11=F$2,ROW(C$2:C$11))),ROWS(F$3:F3))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy across to I3 then down until you get a row full of blanks.

    Here's your file with this implemented:

    Book1(1).xlsx
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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