How to Group a Pivot Table Manually
In this article
Grouping a pivot table manually lets you combine related items—like individual dates into weeks or months, or specific product names into categories—without changing your source data. This is useful when automatic grouping doesn't give you the exact buckets you need, or when you want to group text values that aren't dates or numbers. You can do this in Excel and Google Sheets using a simple drag-and-drop or right-click method. Before you start, make sure your pivot table is already created and contains the field you want to group.
What You'll Need
- A pivot table already inserted in your spreadsheet (Excel 2010 or later, or Google Sheets).
- The field you want to group must be in the Rows or Columns area of the pivot table.
- For date or number grouping, the field should contain actual date values or numbers, not text.
Step-by-Step
- Select the items to group. In your pivot table, click on the first item you want to group. Then hold the Ctrl key (Windows) or Cmd key (Mac) and click each additional item you want to include. For a contiguous range, you can click and drag over the item labels.
- Right-click and choose “Group”. With the items selected, right-click on one of the selected cells. In Excel, choose Group from the context menu. In Google Sheets, the option is Group as well (sometimes under “Create pivot group”).
- For dates/numbers (Excel only): If you select a single date or number cell, Excel will open a Grouping dialog box. Here you can set the starting and ending dates, and choose the grouping interval (Days, Months, Quarters, Years). For manual grouping, you typically skip this dialog and instead select multiple items as in step 1, which groups them into a custom bucket.
- Name your group (optional but recommended). After grouping, Excel automatically names the group “Group1” (or similar). To rename it, click on the group name in the pivot table, type a new name, and press Enter. In Google Sheets, the group appears as a new field item; you can click on it and type a new name.
- Ungroup if needed. To undo a manual group, select the group name (or any item within it), right-click, and choose Ungroup. This restores the original items.
For a practical example, imagine you have a pivot table with daily sales dates. To group them into weeks manually, you could select the dates for week 1 (e.g., Jan 1–Jan 7), right-click, and choose Group. Then rename that group to “Week 1”. Repeat for each week. This gives you full control over the week boundaries, unlike Excel’s automatic grouping which may start weeks on a specific weekday.
Common Mistakes
- Selecting the wrong cells. You must select the item labels (the actual text or date values), not the data values in the Values area. Clicking on a sum or count cell won’t allow grouping.
- Grouping non-contiguous items incorrectly. If you hold Ctrl and click items that are not adjacent, they will still group together, but the order in the group may be based on the original order, not the order you clicked. This can be confusing if you expect a specific sequence.
- Forgetting to rename groups. Default names like “Group1” are not descriptive and can make your pivot table hard to read. Always rename to something meaningful.
- Grouping when the field is in the Filters area. Manual grouping only works for fields in the Rows or Columns area. If your field is in Filters, move it to Rows first.
- Grouping dates that are not recognized as dates. If your date column is stored as text, Excel won’t allow date grouping. Convert the text to dates using the DATEVALUE function or Text to Columns.
Tips
- Use automatic grouping first. For dates, try Excel’s automatic grouping (right-click on a date, select Group, and choose Months/Quarters etc.) to see if it meets your needs. Manual grouping is best when you need custom ranges that automatic grouping can’t provide.
- Group multiple fields at once. You can select items from two different fields (e.g., Product A and Product B) and group them together, creating a combined category. This works as long as both fields are in the same area (Rows or Columns).
- Use the PivotTable Field List to see groups. After grouping, the field name in the Field List gets a small folder icon. Expand it to see the individual items and the group name.
- Sort groups manually. After grouping, you can drag the group name to reorder it. This is useful when you want a specific order that isn’t alphabetical.
- Keep your source data clean. Manual grouping is a temporary view; if you refresh the pivot table, the groups remain, but if you add new items that should be in a group, you’ll need to include them manually.
Troubleshooting
- Group option is grayed out. This usually means you selected a cell in the Values area, or the field is in the Filters area. Select the row/column label cells instead. Also, ensure you are not in edit mode (e.g., typing in a cell).
- Grouping dates gives an error “Cannot group that selection.” This happens when the date field contains text values or blank cells. Check your source data for any non-date entries. Also, make sure the dates are in a recognized date format (e.g., 01/15/2024).
- After grouping, some items disappear. This can occur if you selected only some items and grouped them, leaving others ungrouped. The ungrouped items still exist but may be hidden under “(blank)” or as separate items. Expand the field to see all items.
- Grouping works but the group name doesn’t stick. If you rename a group and it reverts, it might be because you are typing in the wrong cell. Click on the group name label (not the value) and then type. Also, ensure you press Enter to commit.
- Google Sheets doesn’t offer the same grouping dialog. Google Sheets has a simpler grouping feature. If you can’t find the Group option, try selecting multiple items, then right-click and look for “Group” or “Create pivot group”. If it’s not there, you may need to use a calculated field or add a helper column to your source data.
Frequently Asked Questions
Can I group text values in a pivot table?
Yes, you can group any text values by selecting multiple items and right-clicking to Group. This creates a custom category that combines those items.
Does manual grouping affect my original data?
No, grouping only changes the display in the pivot table. Your source data remains untouched. If you refresh the pivot table, the groups stay, but new data may not automatically be included in existing groups.
How do I group dates into weeks manually?
Select the specific dates you want in week 1, right-click, and choose Group. Rename the group to “Week 1”. Repeat for each week. This gives you full control over week boundaries.
Why can’t I group dates in my pivot table?
Common reasons: the date column contains text, there are blank cells, or the field is not in the Rows/Columns area. Convert text to dates and ensure the field is in the Rows or Columns area.
Can I group multiple fields into one group?
Yes, you can select items from different fields (e.g., Product A and Product B) and group them together, as long as both fields are in the same area (Rows or Columns).
How do I ungroup items?
Select the group name or any item within the group, right-click, and choose Ungroup. This will separate the items back to their original state.