# How do I do a pivot table in Numbers?

I can't find any equivalent of the Excel Pivot Table or Open Office Data Table features. I'd like to sum up my data grouped by values in various columns.

For example, if I have

``````A       B       C
red     left    2
red     left    3
green   left    4
green   right   4
``````

I want to be able to get

``````        red     green   all
left    5       4       9
right   0       4       4
all     5       8       13
``````
-
Apparently there is a categories feature that gives some of this power, but I'm still looking for a better answer. macmost.com/pivot-tables-in-iwork-09-numbers.html – Kevin Peterson May 26 '12 at 0:56
What led you to think pivot tables are implemented in Numbers. It's not there AFAIK. – bmike Apr 13 '13 at 20:33

Assuming the tables are named Original and Pivot, the cells in Pivot are filled using this formula:

``````=SUMIFS(Original::\$C, Original::\$A, "="& \$A2, Original::\$B, "="& B\$1)
``````

i.e. sum values in `Original::\$C` if

• corresponding value in `Original::\$A` = value in first column of Pivot
• corresponding value in `Original::\$B` = value in first row of Pivot

The 'all' values are just simple sums of those rows or columns.

-