■
Tip
To select the remaining stores, drag down through the list of store numbers in the Row Labels area. You can include the store number headings that were created.
As an alternative to grouping the stores in the pivot table, you could add a StoreType
field to the source data, and then enter Old or New for each record. Add the StoreType field as the first field in the Row Labels area and the stores will appear under the correct Store-
Type heading.
5.6. Grouping Dates by Month
Problem
Your pivot table is based on two years of sales data. When you group the order dates in your pivot table by month, the January data from both years is lumped together. You’d like to keep
the data from different years separated, so you can compare the monthly data between years. This problem is based on the GroupMonth.xlsx sample workbook.
Solution
When you group the dates, select both Year and Month in the Group By list. With this type of grouping, data from each year is grouped, and within each year, the data for each month is
grouped. A Years field is automatically added to the PivotTable Field List, and you can move it to a
different area of the pivot table. For example, you could move Years to the Report Filter area, and leave the OrderDate field, showing Months, in the Row Labels area.
5.7. Grouping Dates Using the Starting Date
Problem
You want to group the order dates into four-week periods that coincide with your sales calen- dar. You successfully group the dates, but the date ranges are a couple of days off, starting
midweek instead of on a Monday. This problem is based on the GroupStart.xlsx sample workbook.
Solution
When you group the dates, select to group by days, and set the number of days to 28. As a starting date, Excel automatically selects the first date in your source data, but you can enter a
different date, to get the starting date you need. For example, if the default starting date is Thursday, January 3, 2008, you could enter
December 31, 2007 as the starting date for your grouping see Figure 5-7. This forces all the groupings to start on a Monday, and it matches the company’s sales periods.