+ Reply to Thread
Results 1 to 7 of 7

Thread: Pivot: sort by two columns

  1. #1
    Forum Guru
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Excel 2010
    Posts
    1,502

    Pivot: sort by two columns

    I have a worksheet with the following columns:
    DEPTID, POSITION, PROGRAM, VENDOR Name, and Grand Total

    From this data, I want to create a pivot table, with DEPTID, POSITION, VENDOR Name and Grand Total for my fields. I can do that just fine, but I want my DEPTIDs to be in Ascending Order, and within each Dept ID I want my Grand Totals in Ascending order. How do I do that?

    I appreciate any help.
    Last edited by jomili; 01-27-2012 at 02:27 PM.

  2. #2
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,285

    Re: Pivot: sort by two columns

    Hi jomili,

    I think you need to group the row data and then sort within the group. See if http://www.excelforum.com/excel-gene...-in-excel.html doesn't help. I think I gave an example on it. If not then supply a sample workbook and we'll see if we can make it do what you want.
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    12-03-2009
    Location
    Firenze, Italy
    MS-Off Ver
    Excel 2000 XP
    Posts
    436

    Re: Pivot: sort by two columns

    Hi,

    if you click twice on the grey label of right-most row field (maybe DEPT ID), you can open the pivot table window: click on Advanced then- in the new window -select Autosort option- Ascending -using field "Grand total".

    I hope this is useful.

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon below the post.

    Please, mark your thread [SOLVED] if you received your answer.

    Forum rules: http://www.excelforum.com/forum-rule...rum-rules.html

  4. #4
    Forum Guru
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Excel 2010
    Posts
    1,502

    Re: Pivot: sort by two columns

    Marvin,
    I didn't find anything in the link that would help with me present situation. See the attached workbook to see if this makes my problem any more clear. I'm open to either a manual method within the PT setup, or a VBA solution.

    Canapone,
    See the attached workbook. I tried your solution, but couldn't get it to work. If I sort by Grand Total, I lose my sort by DeptID. I need both.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    12-03-2009
    Location
    Firenze, Italy
    MS-Off Ver
    Excel 2000 XP
    Posts
    436

    Re: Pivot: sort by two columns

    Hi, I've set ascending order by clicking -also- on "Position" label in M3.

    Hope it helps
    Attached Files Attached Files
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon below the post.

    Please, mark your thread [SOLVED] if you received your answer.

    Forum rules: http://www.excelforum.com/forum-rule...rum-rules.html

  6. #6
    Forum Guru
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Excel 2010
    Posts
    1,502

    Re: Pivot: sort by two columns

    A-ha! I knew there had to be a way! Thank you so much for point it out.

  7. #7
    Valued Forum Contributor
    Join Date
    12-03-2009
    Location
    Firenze, Italy
    MS-Off Ver
    Excel 2000 XP
    Posts
    436

    Re: Pivot: sort by two columns

    Hi,

    forgot the subtotals in the pivot table.

    Regards
    Attached Files Attached Files
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon below the post.

    Please, mark your thread [SOLVED] if you received your answer.

    Forum rules: http://www.excelforum.com/forum-rule...rum-rules.html

+ 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.2.0