Problem with Averages in Pivot Table

rafa1

New Member
Joined
Apr 16, 2012
Messages
2
Hello,

I have a table of data in Excel 2010 that looks like this:

data_table.png


After transforming the data into a pivot table and adding a calculated field ‘Quality x Number’, it looks like this:

pivot_table.png


The field list looks like this:

pivot_table_field_list.png


What I am trying to do is add a ‘Real Quality’ column or calculated field to the table. ‘Real Quality’ should be the sum of ‘Quality x Number’ for each Fruit, divided by the total number of each Fruit.

For example, ‘Real Fruit Quality’ for Berries should be:

((4 x 100) + (8 x 5) + (9 x1)) / (100 + 5 + 1) = 449/106 = 4.24

And ‘Real Fruit Quality’ for Nut should be:

((4 x 3) + (2 x 4) + (8 x 150)) / (3 + 4 + 150) = 1220/157 = 7.77

So with the ‘Real Fruit Quality’ Field added, the table should look like:

target_table.png


I am really struggling to achieve this. Finding a way of taking the sum of the ‘Quality x Number’ field for each Fruit, and then dividing that figure by the total of Number for the Fruit, is proving difficult.

Does anybody know of a way that this can be achieved in Excel?

Any help would be greatly appreciated.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You can do this in your original table of data by adding 2 columns:
Col E (Quality x Number) Enter in E2: =C2*D2
Col F (Real Fruit Quality) Enter in F2: =SUMIF(A$2:A$7,A2,E$2:E$6)/SUMIF(A$2:A$7,A2,D$2:D$6)
then copy both formulas down (adjust ending ranges for your data)
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
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