Grouping data by two columns in Excel lets you summarize and analyze relationships between categories—like sales by region and product, or attendance by department and shift. This isn't a single button click; it requires pivot tables or functions like SUMIFS, but when done right, it turns messy data into clear insights. You need Excel 2010 or later and a structured table with consistent headers and no blank rows within your dataset.

What You'll Need

  • Microsoft Excel 2010 or newer (Desktop version; not Excel for the web unless using pivot tables)
  • A dataset with at least two columns of categorical data (e.g., Region, Product)
  • At least one numeric column to aggregate (e.g., Sales, Quantity)
  • No blank rows or mixed data types within the source range

Step-by-Step

  1. Open your Excel workbook and ensure your data is organized in columns with clear headers—like "Region", "Product", and "Sales"—with no empty rows between data entries.
  2. Select any single cell inside your data range. Do not select the entire table manually; just click inside one cell.
  3. Go to the Insert tab on the ribbon, then click PivotTable.
  4. In the Create PivotTable dialog box, confirm the range is correct (Excel usually auto-detects it). Choose where to place the PivotTable: New Worksheet is recommended for clarity. Click OK.
  5. In the PivotTable Field List pane that appears on the right, drag the first column you want to group by (e.g., Region) into the Rows area.
  6. Drag the second column (e.g., Product) into the Rows area, directly below the first field. Excel will nest it under the first, creating a hierarchical group.
  7. Drag the numeric column you want to summarize (e.g., Sales) into the Values area. By default, Excel will sum the numbers. If it shows Count instead, click the dropdown arrow next to it in the Values area, choose Value Field Settings, then select Sum.
  8. Review the PivotTable: you should now see each unique combination of Region and Product, with the total Sales for each pair.
  9. To sort the results, click the dropdown arrow next to the first row label (e.g., Region), then choose Sort A to Z or Sort Z to A. You can also sort by the summed values by clicking the dropdown in the Values column and selecting Sort Largest to Smallest.
  10. Optional: To add filters, drag another column (e.g., Year or Salesperson) into the Filters area. This lets you toggle views without changing the structure.
  11. Format the numbers: Select the Values column, right-click, choose Number Format, then select Currency or Number with desired decimal places.

Common Mistakes

  • Trying to group by two columns using Sort or Filter alone—this only rearranges data, it doesn’t summarize it.
  • Leaving blank rows or mixed data types (e.g., text in a numeric column) in the source data, which causes the PivotTable to misread the range.
  • Dragging the same field twice into Rows when you meant to use it in Values—this duplicates rows instead of summing.
  • Using Excel for the web and expecting advanced formatting options that aren’t available—stick to the desktop app for full control.
  • Not refreshing the PivotTable after updating source data—right-click the PivotTable and select Refresh to update totals.

Tips

  • Convert your data range to an Excel Table (Ctrl + T) before creating the PivotTable—this makes it auto-expand when you add new rows.
  • Use descriptive field names in your source data. Instead of "Col1" or "A", use "Sales Region" or "Order Date"—this makes the PivotTable much easier to read.
  • Right-click any value in the PivotTable and choose "Show Values As" to display percentages of row, column, or grand total for deeper analysis.
  • For quick summaries without a PivotTable, use SUMIFS: =SUMIFS(SalesRange, RegionRange, "North", ProductRange, "Widget") to sum sales for North region and Widget product.
  • Hold Ctrl while clicking multiple items in the Rows area to see only selected combinations, useful for isolating subsets.
  • Use the PivotTable Analyze tab to change layout, add calculated fields, or export to PDF for reports.

Troubleshooting

  • PivotTable doesn’t show grouped data — Check that both columns you’re dragging into Rows are text or date fields, not numbers formatted as text. Convert them using the Text to Columns tool under Data tab if needed.
  • Values show Count instead of Sum — Excel assumes text data means you want a count. Right-click the value field, choose Value Field Settings, and select Sum.
  • Some rows are missing — Look for hidden characters in source cells (like trailing spaces). Use TRIM() in a helper column to clean them, then refresh the PivotTable.
  • PivotTable won’t update after adding new data — If you didn’t use a Table, the range didn’t expand. Either convert to a Table (Ctrl + T) or manually adjust the PivotTable data source: right-click PivotTable > Change Data Source > select the updated range.
  • Blank rows appear in results — Delete any empty rows in your source data. PivotTables treat blank rows as separators and may misinterpret the data structure.
  • Grouping doesn’t work as expected with dates — If one column is a date, right-click any date in the PivotTable and choose Group to break it into Months, Quarters, or Years. Then add your second column as usual.

Frequently Asked Questions

Can I group by two columns without using a PivotTable?

Yes, but only for simple lookups. Use SUMIFS, COUNTIFS, or AVERAGEIFS functions to calculate totals for specific combinations. For example: =SUMIFS(Sales, Region, "East", Product, "Laptop"). This doesn’t create a summary table—it gives you one number at a time.

Why does Excel sometimes group numbers instead of text?

Excel treats numbers formatted as text as text. If your columns look like numbers but are aligned left (not right), they’re text. Use the Convert to Number option under the warning triangle in the cell, or use VALUE() to convert them.

Can I group more than two columns?

Yes. You can drag additional columns into the Rows area of the PivotTable. Excel will nest them in the order you add them. Up to 10 or more are possible, but too many can make the table hard to read.

What if my data has duplicate rows?

Duplicates are fine. PivotTables automatically sum or count them. If you want to see each row individually, don’t use a PivotTable—use Advanced Filter or Remove Duplicates under the Data tab first.

Does this work with Excel Online?

Yes, but with limitations. PivotTables work in Excel for the web, but you can’t change layout options like layout style or add calculated fields. For full control, use Excel desktop.

Can I group by two columns and show averages instead of sums?

Yes. After dragging your numeric field into Values, click the dropdown arrow next to it, choose Value Field Settings, then select Average instead of Sum. This works for any aggregation: Max, Min, Count, etc.