Pivot Table - Sort by Year Without Grouping

Jamsandwich

New Member
Joined
Sep 25, 2014
Messages
44
Hey guys,

I've generated a pivot table with dates as Row Labels. The source data has several entries for each day so I've had to group the Row Labels by day.

This has had the effect of taking out the year from the dates (now dd-mmm). So when the data goes back beyond the beginning of this year, last years dates are automatically sorted to the bottom of the dataset.

I know that I can group by year too, but this adds rows that I don't want (I have another table being generated from the pivot table rows, important that row data remains as is).

Is there a way to group the rows by day while retaining dd-mmm-yy format? Or can I get the year to appear in a seperate column rather than a row?

Excel 2010.
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,177
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
If you have the pivot table in tabular layout you will get a new column. Is your other table linked using formulas?
 

Jamsandwich

New Member
Joined
Sep 25, 2014
Messages
44
Oh wow, that was easy.

Yeah, my next table's first column is "=PivotSheet!B5" with the row number changing for each row of course. This is a table that allows me to produce Statistical Process Control charts.

Having the year in the same column screwed up all the formulas. Didn't realise I could switch to a different layout though. Never actually used a pivot table before, great tool.

That fixed it. Thanks once again Rory.
 
Last edited:

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,177
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
I'd suggest you use GETPIVOTDATA formulas instead - then it won't matter what the layout of the table is. The syntax is a little trickier than a simple cell link, but it's more robust.
 

Jamsandwich

New Member
Joined
Sep 25, 2014
Messages
44
OK, thanks for the advice.

I'll have a look into that formula and see if I can improve my sheets.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,907
Messages
5,489,644
Members
407,703
Latest member
Chibuzo

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top