Sorting Grouped Dates in Pivot Table

G

Gio Bacareza

Having problems sorting grouped dates in a pivot table report. I have a
column filled with dates. I run pivot table and sort the dates in ascending
order. Everything's fine. Then I group the dates by 7 days (since there's no
automatic weekly grouping.) The resulting pivot table have a weird sorting:

3/29/2004 - 4/4/2004
4/12/2004 - 4/18/2004
4/19/2004 - 4/25/2004
4/26/2004 - 5/2/2004
4/5/2004 - 4/11/2004
5/3/2004 - 5/9/2004

I have made sure that all the other visible fields (page and column) have no
sorting order.

Why is this happening?

gio
 
D

Debra Dalgleish

The date range is a text string, and 4/26 comes before 4/5 when sorted
alphabetically.

You could ungroup the dates, sort, then regroup them, and the order
should be correct.
 
G

Gio Bacareza

I thought about the text string treatment by Excel but what I don't
understand is that even when I countlessly ungrouped, sorted and regrouped
it was still the wrong sort, which is explained by Excel treating it as a
string. However, when I deleted the whole sheet and made a new pivot table,
the sorting of the group date is right this time.

What I dont get is that why sometimes Excel treats it as a string which
causes 4/26 to come before 4/5 but sometimes sorts it chronologically?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top