+ Reply to Thread
Results 1 to 18 of 18

Sort by Month and year in pivot table

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Sort by Month and year in pivot table

    I am pretty new to pivot tables but I did create the attached pivot table,

    For some reason in the "Sales by Month" Pivot table it doesn’t recognize it as a Date format only as a Text format as it doesnt sort by date, I assume its because of the function in the “Month&Year” column in sheet, please advise what I am doing wrong,

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sort by Month and year in pivot table

    I added a new colum with the formula =month(a1) in it.

    I formatted it as 00

    After that i made an pivot table.

    Do you have question or comments, just ask or comment.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Sort by Month and year in pivot table

    Thanks, but this doesnt work for me as I need the the row labels should be the customer names,

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sort by Month and year in pivot table

    Maybe this way?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Sort by Month and year in pivot table

    Thanks, yes this sounds great,

    Question: what do you mean with "I formatted it as 00" in the first reply, how did you do it?

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sort by Month and year in pivot table

    Cellproporties (last option) and the instead of standard use 00

  7. #7
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Sort by Month and year in pivot table

    Thanks, I really appreciate your help,

    How about having the name of the month, for example Jan, Feb, instead of the number, and then to be able to sort it by month?

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sort by Month and year in pivot table

    Then you get april (letter A) first, that's why I used 01 - 12 instead of text.

  9. #9
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Sort by Month and year in pivot table

    so what I am understading is that if I want to sort it by month (oldest to newest) we have to use numbers instead of text?

  10. #10
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Sort by Month and year in pivot table

    Hi mb1074

    If you group your dates, there should be no need for the extra column.
    See the attached, is that of any help!
    Attached Files Attached Files
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  11. #11
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Sort by Month and year in pivot table

    Thanks Kavin, this sounds much better,

    If I may ask, how do I group the dates?

    Thanks again,

  12. #12
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Sort by Month and year in pivot table

    Hi mb1074

    Right click one of the months in the pivot table, select ungroup. Then right click one of the dates, then ensure the months is selected, click OK.

  13. #13
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Sort by Month and year in pivot table

    Thank you soo much, this works great,

    BTW, was there a need to create a year column to be able to group by year and date, or can it be worked out from the transactiondate column itself?

  14. #14
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Sort by Month and year in pivot table

    I'm not sure on that. If there is a way of having another Transactiondate field, you should be able to get the years. But I do not know how! Sorry, perhaps someone will come up with a answer. Interesting though, will have to look into that.

  15. #15
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Sort by Month and year in pivot table

    Kevin,

    Why when I follow your steps on grouping by month in my actual spreadsheet there is a message "Cannot group that selection."?
    Last edited by mb1074; 01-18-2013 at 01:24 PM.

  16. #16
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Sort by Month and year in pivot table

    Hi

    It works over here. See the picture.

    Sort by Month and year in pivot table.PNG

  17. #17
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Sort by Month and year in pivot table

    Hi mb1074

    See the attached. i have deleted both your Year & the Month/Year columns in your data table. When you group the Transactiondate field, select both year & months for groups. Then have the Transactiondate field for column labels (Months) and the new year group for row labels.

    See the attached sheet.
    Attached Files Attached Files
    Last edited by Kevin UK; 01-18-2013 at 02:52 PM. Reason: Updated Pivot Table

  18. #18
    Registered User
    Join Date
    01-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Sort by Month and year in pivot table

    Thanks a million, Kevin,

    I ran again my report, it works great, i marked this thread solved.

+ 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