Count vs Sum in pivot tables

cthompson

Board Regular
Joined
Jan 31, 2011
Messages
80
Hi all (again)

One last question on pivot tables. Why when adding a column label to a pivot table it will default to a sum of the data and other times a count of the data? I have noted these differences when one set of data is text and the other is numeric and that makes sense. However there are times when both sets of data are numeric but the pivot table will count one list and sum the other. I sorry this is one of the other annoying things that drive us all crazy.

Chris
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi,

Interesting. I've only ever seen it default to 'Count of' if at least one value in that field is not numeric. Perhaps you can post a small, mocked-up column or two for which the associated Pivot Table exhibits the behaviour you outline?

Regards
 
Upvote 0
However there are times when both sets of data are numeric but the pivot table will count one list and sum the other.

I'd assume you have one or more blanks in your first dataset - that would cause a default of Count.
 
Upvote 0
I think I have identified the problem.

I created 2 pivot tables the top one was initially had in both set 1 and set 2 data either blanks or a number with a label prefix and the pivot table recognized both sets as text and used count in the summations. In the second pivot table i used numeric in both data sets and the pivot table recognized both as numbers and used the sum function.

What was interesting was when i replaced the data from the second table back to the first table no matter if i redefined "change data source" for the first pivot table and regardless of what kind of number was replaced both sets of data were recognized as a label and the count function was employed by the pivot table.

So it seems that the first time a pivot is created will define how the data will be treated unless you completely delete the pivot and redefine a new table from scratch. In most cases where I have noticed this problem is when I am re-organizing an existing pivot table and adding or modifying the underlying data.

Thanks again for the help, again one of the small annoying things when using the pivot table
Chris

Pivot table 1
Row Labels
Count of Set 1Count of Set 2Data 1
A1LableSet 1Set 2
B11A2000
C11B3001
D11C4002
E11D5003
F1E6004
G11F7005
Grand Total
66G8007
Pivot table 2
Row LabelsSum of Set 1Sum of Set 2Data 2
AA5003
AB
6004LableSet 1Set 2
AC
7005X2000
AD
8007y3001
X
2000Z4002
y
3001AA5003
Z
4002AB6004
Grand Total
350022AC7005
AD8007

<colgroup><col><col span="2"><col span="7"></colgroup><tbody>
</tbody>
 
Upvote 0
So it seems that the first time a pivot is created will define how the data will be treated unless you completely delete the pivot and redefine a new table from scratch. In most cases where I have noticed this problem is when I am re-organizing an existing pivot table and adding or modifying the underlying data.

All you have to do is change the function to Sum if that's what you need. The Count is merely a default, not a fixed option.
 
Upvote 0
Thanks again, and we do make that adjustment. My curiosity always gets the better of me as to why something works one way and not necessarily the other.
CT
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,942
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