Pivot Table Day of Week Averages

BBalazs

New Member
Joined
Apr 6, 2013
Messages
11
Hi All!

I've been searching all over the place for a solution to this issue. While I found many similar threads, none have helped me resolve the problem, so I'm asking for your help.

I have data arranged in the following manner (but it cannot be sorted this reliably):
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date
[/TD]
[TD]Fruit
[/TD]
[TD]Amount
[/TD]
[TD]Day Of Week
[/TD]
[/TR]
[TR]
[TD]2013.06.01
[/TD]
[TD]Apple
[/TD]
[TD]10
[/TD]
[TD]Saturday
[/TD]
[/TR]
[TR]
[TD]2013.06.01
[/TD]
[TD]Pear
[/TD]
[TD]20
[/TD]
[TD]Saturday
[/TD]
[/TR]
[TR]
[TD]2013.06.02
[/TD]
[TD]Apple
[/TD]
[TD]30
[/TD]
[TD]Sunday
[/TD]
[/TR]
[TR]
[TD]2013.06.02
[/TD]
[TD]Pear
[/TD]
[TD]40
[/TD]
[TD]Sunday
[/TD]
[/TR]
[TR]
[TD]2013.06.03
[/TD]
[TD]Apple
[/TD]
[TD]10
[/TD]
[TD]Monday
[/TD]
[/TR]
[TR]
[TD]2013.06.04
[/TD]
[TD]Apple
[/TD]
[TD]20
[/TD]
[TD]Tuesday
[/TD]
[/TR]
[TR]
[TD]2013.06.05
[/TD]
[TD]Apple
[/TD]
[TD]30
[/TD]
[TD]Wednesday
[/TD]
[/TR]
[TR]
[TD]2013.06.05
[/TD]
[TD]Pear
[/TD]
[TD]40
[/TD]
[TD]Wednesday
[/TD]
[/TR]
[TR]
[TD]2013.06.08
[/TD]
[TD]Pear
[/TD]
[TD]60
[/TD]
[TD]Saturday
[/TD]
[/TR]
</tbody>[/TABLE]
... and so on. Please note the last line, that will be important later on.

Using this data, I've been trying to create a Pivot Table on Average Amount of Fruit Sold per Day of Week. Perhaps it would be easier with array formulas, but I'm really going for a Pivot Table (Pivot Chart actually) because I can add slicers later on (a particularly important feature).

The problem is that if I create a Pivot table with Day Of Week as rows (category axis) and amount as values, things don't add up. While having a "sum of amount" things are fine, but the problem is that I am looking for averages. If I modify the function to "average fo amount", what I get is the following:

[TABLE="width: 221"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Row Labels
[/TD]
[TD]Average of Amount[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Saturday[/TD]
[TD="align: right"]30
[/TD]
[/TR]
[TR]
[TD]Sunday
[/TD]
[TD="align: right"]35
[/TD]
[/TR]
[TR]
[TD]Tuesday[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Wednesday[/TD]
[TD="align: right"]35[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD="align: right"]28,88888889
[/TD]
[/TR]
</tbody>[/TABLE]

Please note Saturday. We had amounts 10, 20 and 60 for Saturday, the average of which data is 30 alright, but there were only 2 actual occurrences of Saturday in the dataset (06.01. and 06.08.) so the correct value would be 45.

Do you have any idea how I could resolve this issue? The actual Dataset is pretty large and much more varied, that is why we're using pivot tables and slicers in the first place; but if this issue is resolved pretty much everything is.

Thanks for your help!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
The only way I can thing of to get what you want is to add a column named Count to your source data with the formula:

=1/COUNTIF(A$2:A$10,A2)

Then in the data area of your pivot table put Sum of Amount, Sum of Count and a calculated field to divide one by the other. Example:


Excel 2010
ABCDEFGHIJ
1DateFruitAmountDay Of WeekCountRow LabelsSum of AmountSum of CountSum of Field1
22013.06.01Apple10Saturday0.5Monday10110
32013.06.01Pear20Saturday0.5Tuesday20120
42013.06.02Apple30Sunday0.5Wednesday70170
52013.06.02Pear40Sunday0.5Saturday90245
62013.06.03Apple10Monday1Sunday70170
72013.06.04Apple20Tuesday1Grand Total260643.33333333
82013.06.05Apple30Wednesday0.5
92013.06.05Pear40Wednesday0.5
102013.06.08Pear60Saturday1
Sheet4
Cell Formulas
RangeFormula
E2=1/COUNTIF(A$2:A$10,A2)
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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