Last updated on November 9th, 2026 at 01:39 pm
To categorize data in Excel, add a column next to your data, give each row a category label, and then sort, filter, or summarize by that column. You can type the labels by hand, choose them from a drop-down list so they stay consistent, or have a formula fill them in automatically based on a value, a keyword, or a lookup table. This guide walks through each approach with formulas you can copy, then shows how to total everything by category.

Step 1: Turn your data into a table
Click any cell in your data and press Ctrl + T, make sure My table has headers is ticked, and click OK. A table expands automatically when you add rows, copies formulas down a column for you, and adds filter buttons to the headers. Everything below works on a plain range too, but a table saves effort.
For the examples, imagine a list of expenses with the description in column A, the amount in column B, and a new Category column in C.
Step 2: Add a Category column
Click the first empty column to the right of your data, type Category as the header, and press Enter. If you used a table, it becomes part of the table immediately.
Step 3: Fill in the categories
Option A: Pick from a drop-down list
Best when a person has to decide the category for each row. A drop-down stops typos like “Food” and “food ” being counted as different categories. If the list later rejects an entry you need, how to remove data validation restrictions in Excel covers when to loosen the rule instead of clearing it.
- On a spare sheet, type your categories in a single column, for example Food, Travel, Utilities, and Other.
- Select the cells in your Category column.
- Go to Data > Data Validation.
- Under Allow, choose List, then click in Source and select your list of categories.
- Click OK. Each cell now has an arrow you can click to pick a category.
Other drop-down settings, such as input messages, are in creating a drop-down list in Excel. For category and subcategory pairs, try linking two drop-down lists so each subcategory list only offers items from the chosen category.
Option B: Categorize by number ranges with IFS
Use this when the category depends on a value, such as sizing orders or grading scores. In C2, type:
=IFS(B2>=1000,"Large",B2>=100,"Medium",TRUE,"Small")
Excel checks each condition in order and returns the first match. The final TRUE catches everything else. IFS is in Excel 2019 and later. In older versions, nest IF functions instead: =IF(B2>=1000,"Large",IF(B2>=100,"Medium","Small")).
Option C: Look up the category from a table
Best when you have a known list of items and the category each belongs to, like products and departments. Make a two-column lookup table on another sheet with the item in the first column and its category in the second, then use:
=XLOOKUP(A2,Lookup!A:A,Lookup!B:B,"Uncategorized")
Any item not in the lookup table shows “Uncategorized,” which makes it easy to spot what’s missing. XLOOKUP is in Microsoft 365 and Excel 2021 and later. In older versions use =IFERROR(VLOOKUP(A2,Lookup!A:B,2,FALSE),"Uncategorized"). In older lookup formulas, the usual way to replace an error with your own text is to use IFERROR in Excel.
A lookup table also works for ranges. List the lower limit of each band in the first column (0, 100, 1000) and the label in the second, sorted smallest to largest, then use =XLOOKUP(B2,Bands!A:A,Bands!B:B,,-1). The -1 tells Excel to use the next smaller value when there’s no exact match. This is easier to maintain than a long IFS formula because you change the bands without editing the formula.
Option D: Categorize by keywords in text
Useful for bank statements, where descriptions are messy. This formula checks whether the description contains a word:
=IFS(ISNUMBER(SEARCH("uber",A2)),"Travel",ISNUMBER(SEARCH("grocer",A2)),"Food",TRUE,"Other")
SEARCH ignores upper and lower case, so “UBER TRIP” and “Uber” both match. Add more pairs for each keyword you need.
Can Excel categorize data automatically?
Yes, with a formula like IFS, XLOOKUP, or SEARCH as shown above. Once the formula is in a table column, new rows are categorized as you add them.
How do I categorize by date, such as by month?
If your dates are in column D, add a column with =TEXT(D2,"yyyy-mm") to label each row by year and month, or group dates in a PivotTable by right-clicking a date and choosing Group.
Step 4: Sort and filter by category
- Sort: click a cell in the Category column, then Data > Sort A to Z. To sort by category and then by amount, use Data > Sort and add a second level, as shown in sorting by two columns.
- Filter: click the arrow on the Category header and tick only the categories you want to see. The FILTER function does the same with a formula, so the results update on their own.
- Color: use Home > Conditional Formatting > Highlight Cells Rules > Text that Contains to give each category its own color. More rule types are in coloring cells based on value.
Step 5: Summarize by category
With SUMIFS and COUNTIFS
Make a small summary table with each category in a column, then next to the first one type: With only one condition, as here, the SUMIF function returns the same total and simply puts the range to add last instead of first.
=SUMIFS(B:B,C:C,E2)
Here E2 holds the category name. Use =COUNTIFS(C:C,E2) to count rows in each category instead.
With a PivotTable
- Click inside your data and choose Insert > PivotTable, then OK.
- Drag Category to Rows and Amount to Values.
You get a total for every category, and it updates when you click Refresh. Layout and formatting choices are explained in making pivot tables in Excel. To include newly added rows or have the totals update each time the file opens, follow how to refresh a pivot table in Excel. Can’t spot the button, or the field list vanished after you clicked away? See finding the PivotTable button and Fields list. To switch those totals to counts or percentages, or to group several categories together, see how to edit a pivot table after you build it.
With GROUPBY
In Microsoft 365, =GROUPBY(C2:C200,B2:B200,SUM) produces the same summary as a PivotTable in one formula that updates automatically. Its other arguments are covered in using GROUPBY in Excel.
With Subtotal
Sort by Category first, then use Data > Subtotal, choose At each change in: Category, Use function: Sum, and tick the Amount column. Excel inserts a total row under each category and adds outline buttons on the left to collapse the detail. To undo it, go back to Data > Subtotal and click Remove All.
Tips for clean categories
- Keep the category list short. A dozen clear categories is easier to report on than fifty narrow ones.
- Always include a catch-all like “Other” or “Uncategorized” so nothing is left blank.
- Use the same spelling every time. A drop-down list or lookup table enforces this.
- Keep the lookup and band tables on their own sheet so they don’t get sorted by accident.

Matt Jacobs writes and maintains the guides on Support Your Tech, which he started in 2017. He spent most of his career keeping small-business PCs running and still takes the occasional consulting job, so the steps here come from fixing the same problems on other people’s computers. Every guide is checked on his own Windows 11, Windows 10, Mac, iPhone and iPad before it goes up.