title: Pivot table custom aggregation function
body: <p>I have a table like this in an excel spreadshhet:</p>
  
  <pre><code>    Col1    |    Col2   |    Col3
   -----------+-----------+-----------
       A      |     X     |      1
       A      |     Y     |      2
       B      |     X     |      3
       B      |     Y     |      4
       B      |     Z     |      5
  </code></pre>
  
  <p>I want to use the aggregation feature of the pivot table.
  Using the typical SUM of VALUES aggregation, provided by Excel, I get:</p>
  
  <pre><code>    Col1    |    Col3
   -----------+-----------
       A      |     3
       B      |     12
  </code></pre>
  
  <p>But I want to use a different aggregation function. I want to use something that does:</p>
  
  <pre><code> Square root of ( Sum of (Square(x)))
  </code></pre>
  
  <p>So that in the end I get the table:</p>
  
  <pre><code>    Col1    |    Col3
   -----------+-----------
       A      |     SQRT(5)      &lt;= Sqrt(1*1 + 2*2)
       B      |     SQRT(50)     &lt;= Sqrt(3*3 + 4*4 + 5*5)
  </code></pre>
  
  <p>Is there ANY way (VBA, C++, assembly, whatever it takes) I can specify my own functions in the aggregation list?</p>
  
  <p><strong>NOTE: I KNOW HOW TO DO THIS IN A SHEET, DON'T BOTHER ANSWERING IF IT'S NOT ABOUT WRITING CUSTOM AGGREGATION FUNCTIONS FOR PIVOTTABLE</strong></p>