Pivot Table: Count total instances across columns

serenepdx

New Member
Joined
Apr 1, 2014
Messages
3
Hi,

I'm trying to do the equivalent of a count() function across the columns of a pivot table, but I can't seem to come up with the right formulation.

For example, I have a list with salesperson, product, sale price, and date. I want to generate a pivot table that looks like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Printer[/TD]
[TD]#[/TD]
[TD]Phone[/TD]
[TD]#[/TD]
[TD]Copier[/TD]
[TD]#[/TD]
[TD]Product Lines Sold[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bill[/TD]
[TD]$300[/TD]
[TD]3[/TD]
[TD]$200[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]$5,000[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]$100[/TD]
[TD]1[/TD]
[TD]$100[/TD]
[TD]1[/TD]
[TD]$1,000[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

It will total and count the sales for each sales person and product. It will also count how many different types of products each sales person sold. This example assumes that each printer, phone or copier sells at the same price, but they will sell at different prices. I am using Excel 2003. I have found that putting a count() function off to the right of the table does not work.

I learned about this forum by finding and implementing
http://www.mrexcel.com/forum/excel-questions/518189-pivot-table-drill-down-new-window.html
and it worked great. Thanks!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
The rows are sales persons. The columns are sum of sale price, and count of sale price. The rows are the products. What I would envision is adding another data item that returns 1 if there was one or more sale for the product and 0 otherwise, but maybe there's another solution?
 
Upvote 0
I could never get the grand total to add up correctly, and that appears to be a known problem, so I went back to add a calculate field to my original sheet that gives a 1 for each unique occurrence of product and sales person, but if there's a way to make it work purely in the pivot table, I'd love to learn!
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,987
Members
452,373
Latest member
TimReeks

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