Pivot Table Averaging based on COUNT of items selected with slicer

mrpaw

Board Regular
Joined
Jan 31, 2011
Messages
80
I have a 22 year data table with about 100 columns of gathered info. I can create all the pivot tables and pivot charts I want with an average based on the total count of years. Great. What I need to do is to create an average of the total based on the count of slicer items selected. Example: Row: Years 1995 - 2016. Column: Total widgets produced. Total Sum for period is 4,685 (bar pivot chart). Total Average is 213 (line in same pivot chart). All is good. But when I add a slicer and the user selects, let's say, 3 years, my averaging formula still shows the 22 year avg. How do I calculate the average of the total widgets for the years selected?

Years selected 1995 - 254 widgets, 2005 - 248 widgets, 2015 - 313 widgets. The line should move from 213 to the new average of 272.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Thank you, yes. But I figured out how to achieve my goal. I neglected to say that in the original data table their are monthly amounts totaled to created the annual totals. I added a helper column in the data table for the annual totals and now all is well. I was trying to avoid adding another column to my data table but I have at least satisfied my goal.

Thank you again.
 
Upvote 0
Thank you, yes. But I figured out how to achieve my goal. I neglected to say that in the original data table their are monthly amounts totaled to created the annual totals. I added a helper column in the data table for the annual totals and now all is well. I was trying to avoid adding another column to my data table but I have at least satisfied my goal.

Thank you again.

I spoke too soon. Still can't get this to work.
 
Upvote 0
OK - figured it out. What a lesson. Googled again and found a You Tube video that put me on the right path. What you have to do is create the original pivot table. Copy and paste everything including the Grand Total line as a link into another worksheet adding any additional formulas (this way any changes to the original source will carry through). In my case it was sum the total and divide by the count. Insert a new pivot table and create your pivot chart. I'm so happy.
 
Upvote 0

Forum statistics

Threads
1,224,146
Messages
6,176,667
Members
452,740
Latest member
CoelhoVermelho

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