Jan 02 2024 09:46 AM
I'll try my best to the describe my problem here.
I'm creating a budget worksheet. I have created a table for transactions, with drop down list for both categories and subcategories, there will be different (but identical) sheets for each month. The subcategories are dependent of the categories (eg. if I choose "Income" I'll get "Salary" & "Sales" as options but not "Insurance").
In the worksheet I want to summarize all the categories and their subcategories based of the transactions. I have created tables for each category, it's here my problem starts.
I created a Pivot table of the transactions, which I base the summary-tables on using "Get.Pivotdata"
=GET.PIVOTDATA("AMOUNT";$L$44;"CATEGORY";"INCOME";"SUBCATEGORY";$G$7) <-- See picture (I7).
I already know that some subcategories won't be used every month, which means it'll be missing in the Pivottable, which then will create an error "#REF!" in the summary <-- See picture.
So my question is: Is there any possibilities to create a formula that writes 0 instead of "#REF!"? Would the =IF_ERROR work? If yes, how should I write it? Or do you have any other recommendations?
I want to keep the worksheet as dynamic as possible, so the only changes should be made in the front page and affect changes to the rest of the sheets.
I hope my description makes sense and that some of you have any ideas for me to solve my problem!
Jan 02 2024 11:19 AM
May I challenge your design, before you get too far into using it?
I have been working on my own budget worksheet (actually more of an income and expense tracker) recently, and would commend to you the basic design approach I've used. I've had it going since 2019, all the way through last year, and will be continuing in 2024.
There are only three sheets in the entire workbook.
My basic point: by having separate sheets for each month, you may be doing more of the work yourself--separating things by month--and failing in that way to let Excel's pivot table tool do the work of that separation and reporting. When we keep records on paper, it makes sense to create that kind of order, but in moving things to Excel, it makes sense to let Excel take care of creating monthly summaries, if needed, quarterly, etc., and doing so from a single ongoing--for as long as you keep your accounts running--database.