Here’s a one-cell fix that also:
- Filters the list of Categories to show only what is selected in F8 (Expense or Income)
- Sorts so the largest magnitude is at the top (because Expenses are negative numbers, they need to use “true” whereas Income needs to use “false” to achieve this)
Replace A12 with:
=IFERROR(INDEX(SORT(FILTER({L$12:L,M$12:M},N12:N<>“Hide”,L12:L<>“”,O12:O=F$8),2,IF(F$8=“Income”,false,true)),1))
By the way, I love this sheet, especially with this tweak, but I also wanted a count of any uncategorized transactions, rather than just the total uncategorized, which it already shows. That way, at a glance I know how many transactions my AutoCat didn’t catch.
B9: add the formula:
=COUNTIFS(Transactions!D2:D,“=”,Transactions!B2:B,“<>”,Transactions!B2:B,“>=”&IF(E2=“”,DATE(1900,1,1),E2),Transactions!B2:B,“<=”&IF(G2=“”,DATE(9999,12,31),G2))
You can also do conditional formatting on that cell so that the text is red if it’s not zero.
Even easier: copy and paste C17 cell from the Tiller “Spending Trends” sheet, and that will paste in the formula and the conditional formatting at the same time.
Exclude Categories:
I went further with this and set up the ability to **exclude categories from the pie chart. (**If you wanted to exclude them from the category list at A12, it can be done but requires more a few more edits for minimal gain).
For me this was useful because I had an unusually large tax bill due to a property sale, and that category was overwhelming the chart.
Create a new dropdown from a range at F10 and refer to the range =A12:A to populate the dropdown.
Update the formula at E12 (from which the chart gets it’s data)
=IFERROR(QUERY({IF(E8=“Category”,L12:L,P12:P),M12:M,O12:O,N12:N},“SELECT Col1,”&IF(F8=“Expense”,“-1*”,“”)&“SUM(Col2) WHERE Col3=”“”&F8&“”" AND Col4<>““Hide””“&IF(F10=”“,”“,SUBSTITUTE(” AND Col1<>‘“&SUBSTITUTE(F10,”, “,”’ AND Col1<>‘“&”“)&”’“,”’ AND Col1<>‘’“,”“))&” GROUP BY Col1 ORDER BY “&IF(F8=“Expense”,”-1*“,”“)&“SUM(Col2) DESC LIMIT “&G8&” LABEL “&IF(F8=“Expense”,”-1*”,”")&“SUM(Col2) ‘’”))
This formula will handle a multi-select dropdown at F10. I only needed to exclude one category and preferred the aesthetics of the single choice list, but if you want multi-choice, this will still work.