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″