Make Pie Chart Aggregate Data from Formatted Table

pahy96

New Member
Joined
Jan 30, 2016
Messages
23
Over the last few days, I have been teaching myself a few things in VBA in order to create a more efficient personal finance tracker that allows me to enter a few items into a user form and automatically populates a Formatted Table. Along with this functionality, I am wanting to have a Pie chart that takes two columns, one with Category Labels, and one with Prices and simply sums the prices that fall in matching Category Labels.

For example, if I have three rows with Food as the Category Label and Prices of 25, 30, and 50, I want the pie chart to show one slice for Food with a total price of 105 (rather than three slices with each individual price).

I am hoping to do this without any additional calculation columns/extra steps and am willing to do this in VBA if necessary. However, I am as green as it comes when talking about VBA, so if there is a solution outside of VBA that would be great.

Thanks!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Welcome to MrExcel.

You could use a Pivot Table and Pivot Chart.

Yeah, I was hoping to avoid that extra step. Since I will have 12 worksheets (one for each month), I didn't want to have 12 additional worksheets of raw data where the pivot tables would be pulling from. If there isn't a more simple solution, would it be faster to create a summary table using vlookups and have the pie chart created from that instead? I'm more thinking out loud than sticking to one idea or another.
 
Upvote 0
Why don't you put all your data on one worksheet with a column for the date?

Ok, I'll run with the pivot table idea. My question would then be how I can add data to the table without having to either expand the data reference for the pivot table or manually refresh the pivot table.

Here is the line of VBA code I am currently using to input a new row of data:

emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1

This is simply finds the next empty row, but I am under the assumption that simply adding data to the next empty row won't be captured by the active pivot table.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top