Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Subcategories: How to Create and Use Them

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To create subcategories in Excel, you need a structured table with a column for the main category and a column for the subcategory, then use sorting, filtering, or a PivotTable to group and summarize the data. This guide walks you through setting up that structure, adding data validation for consistency, and using Excel's built-in tools to view and analyze your subcategories without manually reorganizing rows.

What You'll Need

  • Microsoft Excel (any recent version for Windows or Mac; the steps below work in Excel 2016 and later, and in Excel for Microsoft 365).
  • A dataset with at least two levels of classification (for example, Category and Subcategory).
  • Basic familiarity with selecting cells and using the ribbon.

Step-by-Step

  1. Set up your columns. In a blank worksheet, enter headers in row 1: Category in A1, Subcategory in B1, and any additional fields (Item, Amount, Date) in subsequent columns. Keep one row per record; do not merge cells or leave blank rows inside the data.
  2. Enter your category and subcategory pairs. For each row, type the main category in column A and the specific subcategory in column B. For example, A2 = "Beverages", B2 = "Coffee"; A3 = "Beverages", B3 = "Tea"; A4 = "Snacks", B4 = "Chips". Repeat the main category on every row so each record is self-contained.
  3. Convert the range to a table. Select any cell in your data, then go to Insert > Table (or press Ctrl+T on Windows, Cmd+T on Mac). Confirm the range and check "My table has headers". A table keeps formatting and formulas consistent as you add rows, and it makes filtering and PivotTables easier.
  4. Add data validation to keep subcategories consistent. Select the subcategory column (excluding the header), then go to Data > Data Validation. Under Allow, choose List. In Source, type your subcategory options separated by commas (for example, Coffee,Tea,Juice) or select a range on another sheet where you list them. Click OK. Now each cell offers a dropdown, reducing typos that would split your subcategories into duplicates.
  5. Sort by category and subcategory. Click the filter arrow in the Category header and choose Sort A to Z. Then sort the Subcategory column the same way. This groups all rows of the same category together, with subcategories in order inside each group.
  6. Use filters to view one subcategory at a time. Click the filter arrow in the Subcategory header, uncheck "Select All", then tick the subcategory you want. To see multiple, tick several. Clear the filter by choosing "Select All" again.
  7. Create a PivotTable for a summary. Select any cell in the table, go to Insert > PivotTable, and place it on a new worksheet. In the PivotTable Fields pane, drag Category to the Rows area, then drag Subcategory directly below it in the Rows area (this creates a nested layout). Drag a numeric field such as Amount to Values. Excel will show each category with its subcategories indented beneath, plus totals.
  8. Collapse or expand subcategories. In the PivotTable, use the small minus and plus buttons next to each category to hide or show its subcategories. This gives you a clean summary view without deleting rows.
  9. Add a subtotal row (optional). If you prefer a plain worksheet view, convert your table back to a range (right-click the table > Table > Convert to Range), then use Data > Subtotal. Choose "Category" as the group, and pick a function such as Sum on your numeric column. Excel inserts a subtotal row after each category group. Note that this adds rows and can interfere with later sorting; keep a backup copy first.
  10. Format for readability. Apply bold to the header row, add a light fill color to category cells or use conditional formatting (Home > Conditional Formatting > Highlight Cells Rules) to color-code categories. This makes the hierarchy easier to scan.

Common Mistakes

  • Leaving the category blank on repeated rows. If you only type the category once and leave the cells below empty, sorting and PivotTables will treat those rows as uncategorized. Fill every row.
  • Inconsistent spelling or capitalization. "Coffee" and "coffee" are different values to Excel. Use data validation or copy-paste from a master list.
  • Merged cells in the data range. Merged cells break sorting, filtering, and PivotTables. Unmerge before building your table.
  • Adding subtotal rows inside the table. Subtotal rows become part of the data and distort counts and sums. Keep raw data clean and use a PivotTable for totals instead.
  • Forgetting to refresh the PivotTable. After editing the source data, right-click the PivotTable and choose Refresh; otherwise it shows old values.

Tips

  • Keep a separate "Lists" sheet with your category and subcategory options, and point data validation to those ranges. It is easier to maintain than comma-separated lists.
  • Name your table (Table Design > Table Name) so formulas and PivotTables can refer to it by name.
  • Use Freeze Panes (View > Freeze Panes) on the header row so it stays visible as you scroll.
  • If you need three levels, add a third column (for example, Sub-subcategory) and nest it in the PivotTable Rows area the same way.
  • Before applying Data > Subtotal, copy the sheet; the operation modifies your layout and is not always easy to undo.

Troubleshooting

  • Sorting mixes up rows. This usually means the sort range did not include all columns. Select the entire table (Ctrl+A inside the table) before sorting, or use the filter arrows, which sort the whole table automatically.
  • Data validation dropdown does not appear. Check that the cell is not locked in a protected sheet and that the validation applies to the correct range. Also confirm the source list has no blank cells at the top.
  • PivotTable shows "(blank)" for some rows. Those rows have an empty category or subcategory cell. Fill them in the source data, then refresh the PivotTable.
  • Subtotal command is greyed out. It requires a plain range, not an Excel table. Convert the table to a range first (right-click > Table > Convert to Range).
  • Numbers appear as text. If sums are wrong, check that numeric columns are formatted as numbers, not text. Select the column and use Data > Text to Columns > Finish to convert, or reformat the cells.

Frequently Asked Questions

Can I have more than two levels of subcategories?

Yes. Add another column for each level (for example, Category, Subcategory, Sub-subcategory) and nest them in the PivotTable Rows area in order. Sorting and filtering work the same way.

Do I need a PivotTable to use subcategories?

No. You can sort and filter a plain table to group subcategories. A PivotTable is simply the fastest way to summarize and collapse groups without changing your raw data.

Why does my PivotTable not update when I add rows?

If the PivotTable was built from a fixed range, new rows outside that range are ignored. Build it from an Excel table instead, or change the data source (PivotTable Analyze > Change Data Source) to include the new rows, then refresh.

Can I use data validation with a list on another sheet?

Yes. Create the list on a separate sheet, then in Data Validation choose List and select that range. This keeps your dropdown options organized and easy to edit.

What happens if I convert my table back to a range?

The data stays, but you lose table features such as automatic expansion, structured references, and the table style. Sorting and filtering still work on a range, but you must select the full range each time you sort.