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):
Date
Fruit
Amount
Day Of Week
2013.06.01
Apple
10
Saturday
2013.06.01
Pear
20
Saturday
2013.06.02
Apple
30
Sunday
2013.06.02
Pear
40
Sunday
2013.06.03
Apple
10
Monday
2013.06.04
Apple
20
Tuesday
2013.06.05
Apple
30
Wednesday
2013.06.05
Pear
40
Wednesday
2013.06.08
Pear
60
Saturday

<tbody>
</tbody>
... 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:

Row Labels
Average of Amount
Monday10
Saturday30
Sunday
35
Tuesday20
Wednesday35
Grand Total28,88888889

<colgroup><col><col></colgroup><tbody>
</tbody>

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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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
I'd never have thought of such a clever workaround. It worked like a charm, thank you very much.
 
Upvote 0

Forum statistics

Threads
1,214,575
Messages
6,120,334
Members
448,956
Latest member
Adamsxl

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