custom pivot taable calculation based on individual cells

rty1138

New Member
Joined
Jul 23, 2010
Messages
1
i need to do some calculations with pivot tables but i get the wrong/invalid results because i believe calculated fields work with sum totals, not individual cells. my original excel sheet looks like this:

<table x:str="" style="border-collapse: collapse; width: 96pt;" width="128" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt; width: 48pt;" width="64" height="17">flavor</td> <td style="width: 48pt;" width="64">taste</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">chocolate</td> <td x:num="" align="right">5</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vanilla</td> <td x:num="" align="right">3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">chocolate</td> <td x:num="" align="right">4</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vanilla</td> <td x:num="" align="right">2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vanilla</td> <td x:num="" align="right">1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">chocolate</td> <td x:num="" align="right">5</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">chocolate</td> <td x:num="" align="right">2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">chocolate</td> <td x:num="" align="right">5</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vanilla</td> <td x:num="" align="right">1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vanilla</td> <td x:num="" align="right">4</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">chocolate</td> <td x:num="" align="right">3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">chocolate</td> <td x:num="" align="right">5</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vanilla</td> <td x:num="" align="right">3</td> </tr> </tbody></table>

my pivot table looks like this:

<table x:str="" style="border-collapse: collapse; width: 215pt;" width="286" border="0" cellpadding="0" cellspacing="0"><col style="width: 76pt;" width="101" span="2"> <col style="width: 63pt;" width="84"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt; width: 76pt;" width="101" height="17">flavor</td> <td class="xl24" style="width: 76pt;" width="101">Data</td> <td class="xl27" style="width: 63pt;" width="84">Total</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">chocolate</td> <td class="xl24">Average of taste</td> <td class="xl27" x:num="4.1428571428571432" align="right">4.142857143</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl26" style="height: 12.75pt;" height="17"> </td> <td class="xl30">StdDev of taste</td> <td class="xl31" x:num="1.2149857925879122" align="right">1.214985793</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">vanilla</td> <td class="xl24">Average of taste</td> <td class="xl27" x:num="2.3333333333333335" align="right">2.333333333</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl26" style="height: 12.75pt;" height="17"> </td> <td class="xl30">StdDev of taste</td> <td class="xl31" x:num="1.211060141638997" align="right">1.211060142</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" colspan="2" style="height: 12.75pt;" height="17">Total Average of taste</td> <td class="xl27" x:num="3.3076923076923075" align="right">3.307692308</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl28" colspan="2" style="height: 12.75pt;" height="17">Total StdDev of taste</td> <td class="xl29" x:num="1.4935759876113539" align="right">1.493575988</td> </tr> </tbody></table>


i need to have a third datafield that calculated root mean squared the following way:
sqrt(4.14^2+1.21^2) for chocolate
&
sqrt(2.33^2+1.21^2) for vanilla


i don't want this to be outside the pivot table. it want it to be integrated in it so i can drag and drop it and it will automatically generate. if anyone could help, i would greatly appreciate it. thank you!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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