Numbers: Best way to create multi-level expense categories with auto totals

I am improving a spreadsheet I have that tracks expenses by category. This is for occasional personal use for events.

I want to have data organized as follows (either with one sheet having all expenses listed chronologically, and another with the line items grouped and summed; or just use one sheet).


1st level category (which has a grand total column; I've done this successfully)

    2nd level category (with a grand total column)

        line items (with expense costs, etc.


Besides the organization of data, the cost data I need is:


A) Cost of each item (in the line item row) (also columns for data, vendor, notes, which is no issue here).

B) 2nd level category total: sum of all line item costs (sub categories)

C) 1st level category total: sum of all 1st level category totals (top level categories)

D) Grand total: sum of all 1st level category totals.


I would prefer to enter all costs chronologically, and then have them established in the two category levels by calculations or similar, in a sheet separate from the data entry sheet. (I did something similar in (Mac Classic Excel probably in the '90s, where I had expenses with categories, that were then summed into categories in another sheet using macros manually to do the work, but I think this can be done 'live' in Numbers). If this is not feasible, I could live with creating ad hoc columns for the two category levels, one in column A, the other in column B, and line items in columns C, etc., as seen in the hierarchy above. This is a bit kludgy, because I have to add extra rows when I need more room for line items, and it doesn't meet my ideal of being able to enter everything chronologically, and then have it broken into the two category groups in another sheet.


There is the other option of using category group columns which I address following.


The ways of accomplishing this (with my knowledge so far), are:


1) In the expense line item rows, don't use any category groups (no header columns), and format one column's cels to pop up a list of categories stored in a constants sheet (I've done this). Then use some sort of calculation(s) (/automation) to 'place' the expenses in the two category groups, in another sheet. This is my ideal solution.


The data entry sheet would look something like:


date   vendor   description   $cost


The summary sheet would look something like:


1st level category A   $Grand total

  2nd level category A  $Total

    Line item 1 (date, cost, etc.)

    Line item 2

  2nd level category B   $Total

    Line item 3

    Line item 4


2) Use 2 header columns so the sums for the two category totals are automatic. One downside for me is that I'm not able to see and enter all expenses chronologically. Also, while I'm able to create 2 (or 3) category columns, the first column displays a disclosure triangle—and I'm able to see all data entry rows when I give the first row  (of the category group) a name (using "Group Name"), but I've not been able to give the second column a group name different than the first group column, thus there is no sub grouping (with a disclosure triangle) to see grouped sub category items). I imagine there is a way to do this, however. Using category groups also requires creating new rows, when need, manually, which is a slight downside for me (there is "Add new row" in the contextual menu with a row selected, but not keyboard shortcut (I do realize I can add one in System Preferences).



--


macOS Sonoma 14.8.7 (23J520)

Numbers 14.5 (7045.0.17)

(I realize there is a later version of Numbers available once I upgrade my macOS—which I will do after I make a major transition from one app to another (both unrelated to Numbers.)

MacBook Pro 14″

Posted on Aug 10, 2026 9:42 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 10, 2026 12:20 PM

Maybe Im wrong, but this just sounds like a pivot table.


Pivot tables were pretty much designed for this use case - one table of semi-organized data, and a second table that collates, filters, and categorizes that data.


The pivot table can automatically extract dates from the source data and categorize by month, year, or quarter. It can group items together based on your 1st or 2nd level categories, then automatically sum the corresponding rows.


Without seeing your actual source data, it's hard to be sure... but I recreated some dummy data based on what you said, using dummy 'Category' and 'Sub-category' labels:



From here, it's 6 clicks to make a Pivot Table that takes the above data and format it like such:



To get this, select any cell in the main table (click 1) and choose Organize -> Create Pivot Table -> On this sheet (click 2)

Then, in the sidebar, drag the field headers from the 'Fields' section in the Inspector into the relevant area you want to see them. In the above case, I dragged 'Sub-category' to the Columns box (click 3); Date to the Rows box (click 4), Category to the rows box (click 5) and $$$ to the Values box (click 6)


Your Inspector should look like this:



Of course, this is only an example based on how I chose to categorize and format the table, but straight away you can see the breakdown of expenses per month, broken out into the sub categories of Cost of Goods, Labor, Shipping, etc. along with subtotals for each category and for each sub-category, and grand totals at the bottom.


Is this close to what you're looking for?

You can drag any of the fields into other sections to reorganize the data differently (e.g. dates in columns rather than rows:



2 replies
Question marked as Top-ranking reply

Aug 10, 2026 12:20 PM in response to bob7

Maybe Im wrong, but this just sounds like a pivot table.


Pivot tables were pretty much designed for this use case - one table of semi-organized data, and a second table that collates, filters, and categorizes that data.


The pivot table can automatically extract dates from the source data and categorize by month, year, or quarter. It can group items together based on your 1st or 2nd level categories, then automatically sum the corresponding rows.


Without seeing your actual source data, it's hard to be sure... but I recreated some dummy data based on what you said, using dummy 'Category' and 'Sub-category' labels:



From here, it's 6 clicks to make a Pivot Table that takes the above data and format it like such:



To get this, select any cell in the main table (click 1) and choose Organize -> Create Pivot Table -> On this sheet (click 2)

Then, in the sidebar, drag the field headers from the 'Fields' section in the Inspector into the relevant area you want to see them. In the above case, I dragged 'Sub-category' to the Columns box (click 3); Date to the Rows box (click 4), Category to the rows box (click 5) and $$$ to the Values box (click 6)


Your Inspector should look like this:



Of course, this is only an example based on how I chose to categorize and format the table, but straight away you can see the breakdown of expenses per month, broken out into the sub categories of Cost of Goods, Labor, Shipping, etc. along with subtotals for each category and for each sub-category, and grand totals at the bottom.


Is this close to what you're looking for?

You can drag any of the fields into other sections to reorganize the data differently (e.g. dates in columns rather than rows:



Numbers: Best way to create multi-level expense categories with auto totals

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.