Counting unique entries in a Pivot Table of based on 50k rows...

EvilGenius007

New Member
Joined
May 26, 2011
Messages
2
So I have some data that looks something like this:

Code:
Bob     Pencil          Writing Utensils
Bob     Pen             Writing Utensils
Chris   Pen             Writing Utensils
Adam    Pen             Writing Utensils
Chris   Legal Pad       Paper
Chris   3-ring binder   Paper
Bob     Pen             Writing Utensils
Chris   Legal Pad       Paper
Chris   Pencil          Writing Utensils
Adam    Pen             Writing Utensils
Chris   Legal Pad       Paper
Chris   Legal Pad       Paper
Bob     Pen             Writing Utensils
Bob     Pen             Writing Utensils
Adam    3-ring binder   Paper

I need a pivot table that looks like:
Code:
Writing Utensils
                Pen     3
                Pencil  2
Total Writing Utensils  3
Paper
        Legal Pad       1
        3-ring binder   2
Total Paper             2

Because 3 unique people have Pens, 2 have pencils, all 3 have a writing utensil, and similarly for paper only 1 person has a legal pad (or 4), etc.

Of course, the actual data is about 50k rows, and the "Pen" values and "Writing Utensils" are found via Vlookup on a product name (i.e. "Bic A7849"=>"Pen", "Mead FFF3"=>"Legal pad")...
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You are asking for 2 different things in your requested PivotTable ... unique counts for item, and also unique count for category. You could easily see the results in 2 PivotTables. You'll need 2 extra columns in your data to mark the unique rows. Have a look here:

Excel Workbook
ABCDEFGHIJ
1NameItemCategoryUnique FlagUnique Cat Flag*Unique Flag0*Page filter for unique items
2BobPencilWriting Utensils00*****
3BobPenWriting Utensils01*Count of Item***
4ChrisPenWriting Utensils00*CategoryItemTotal*
5AdamPenWriting Utensils00*Writing UtensilsPen3*
6ChrisLegal PadPaper00**Pencil2*
7Chris3-ring binderPaper01*Paper3-ring binder2*
8BobPenWriting Utensils12**Legal Pad1*
9ChrisLegal PadPaper12*****
10ChrisPencilWriting Utensils01*****
11AdamPenWriting Utensils11*****
12ChrisLegal PadPaper23*Unique Cat Flag0*Page filter for unique items
13ChrisLegal PadPaper34*****
14BobPenWriting Utensils23*Count of Category***
15BobPenWriting Utensils34*CategoryTotal**
16Adam3-ring binderPaper00*Writing Utensils3**
17******Paper2**
Sheet10
 
Upvote 0
Thanks.! The "COUNTIFS" has me pointed in the right direction. I'm still hashing out the exact details, but I'll follow up with what I end up actually doing.
 
Upvote 0
That's great. In case you can't quite see what I'm doing in the PivotTables, I'm using the COUNTIFS result in the Page Field and selecting to view only the 0 ( zero countifs result ) ... as they are the ones that will give you what you need. Good luck!
 
Upvote 0
Hello,
I did implement this feature ( unique count as a data field) in pivot in excel 2007.
You just have to paste the code and choose the field where you want to count unique.
The advantage is that this is adaptable to most pivot tables, and recalculate according to filters, row and columns fields.
Unfortunatly, it won't calculate the totals for a category


let me know if it's working for you
http://lazyvba.blogspot.com/2010/11/improve-your-pivot-table-to-count.html

regards
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,849
Members
452,948
Latest member
UsmanAli786

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