The Case, five steps guide
A month of card transactions, typed categories with stray spaces and odd capitals, transfers to savings mixed in, and a budget on another sheet. The question at the end: which category used the largest share of its budget? It isn't the one that went over by the most money.
What the question asks
"Largest share of its budget" is spending divided by budget. A big category can go over by more money and still use a smaller share: $144 over a $600 budget is less, in share, than $120 over $300. Decide which number answers the question before you start.
Step by step
- Clean the categories.
=TRIM(B2). " Groceries" and "Groceries " with spaces don't match "Groceries" in a SUMIF. Capitals don't matter there, spaces do. See TRIM. - Spent per category.
=SUMIF($D$2:$D$41, F2, $C$2:$C$41), on the clean column, with the ranges locked before you fill down. Transfers have no row in the summary, so they stay out by themselves. - The budget.
=XLOOKUP(F2, Budget!$A$2:$A$7, Budget!$B$2:$B$7). The Budget sheet lists the categories in another order, so a plain=Budget!B2picks up someone else's number. - Share and status.
=G2/H2as a percent, and=IF(G2>H2, "Over", "OK"). Spending exactly the budget is OK, so the test is>, not>=. - The answer.
=INDEX($F$2:$F$7, MATCH(MAX($I$2:$I$7), $I$2:$I$7, 0)), or=XLOOKUP(MAX(I2:I7), I2:I7, F2:F7).
Check it once by hand
Filter the clean category column to Eating Out and look at the status bar's Sum. If it doesn't match G5, a category is still dirty or a range stops short.
Where it goes wrong
- Totalling the export column. The rows with stray spaces drop out of their category.
- Pointing at the budget row next door. The second sheet isn't in the same order.
- >= for Over. A category that spent exactly its budget shows as over.
- The biggest overspend in money instead of the largest share.
FAQ
- How do I make a monthly budget in Excel?
- List the transactions with a category, total each category with SUMIF, look up its budget, and compare: spending divided by budget gives the share used, IF(spent>budget,"Over","OK") the status.
- Why does SUMIF miss some of my transactions?
- Usually stray spaces in the category text. "Groceries " doesn't match "Groceries". Clean the column with TRIM and total the clean column.
- How do I calculate the percentage of a budget used?
- Divide what was spent by the budget, =G2/H2, and format the cell as a percent. Over 100% means over budget.
- How do I find the category with the highest value?
- Use =INDEX(categories, MATCH(MAX(values), values, 0)), or =XLOOKUP(MAX(values), values, categories).






























































