Excel 2007 pivot table: Count unique distinct records (rows)
Table of Contents
Excel 2007 pivot table: Count unique distinct records (rows)
The table I am working with is in cell range B2:D7. I have then added another column (E) to count unique distinct rows.
Setup table
Formula in cell E3:
Copy cell E3 and paste down to E7.
- Select cell range B2:D7
- Click "Insert" tab on the ribbon
- Click "Pivot table" button
- Choose where you want the pivot table to be placed.
- Click OK.
Setup pivot table
- Click and drag Name, Address and City to row labels.
- Click and drag Count to values.
There are three unique distinct rows (Grand Total)
Excel 2007 pivot table: Count duplicate records (rows)
The table I am working with in this example is in cell range B2:D12. I have then added another column (E) to count duplicate rows.
Setup table
Formula in cell E3:
Copy cell E3 and paste down to E12.
- Select cell range B2:D12
- Click "Insert" tab on the ribbon
- Click "Pivot table" button
- Choose where you want the pivot table to be placed.
- Click OK.
Setup pivot table
- Click and drag Name, Address and City to row labels.
- Click and drag Count to values.
There are six duplicate rows (Grand Total)

Download excel sample file for this tutorial
Pivot table Count unique distinct records.xlsx
(Excel 2007/2010 Workbook *.xlsx
Related posts:
Count unique distinct values in a pivot table in excel
Count unique distinct records in excel 2007
Excel table: Filter unique distinct rows and use additional filters at the same time
List people with the highest scores based on criteria in a pivot table (Excel 2007)





















...all ok with exampke untill the moment of questions: if for e.g. i have two uniques values with the same amount of records.. then dividing will be nothing worse....
..."nothing worth" i have meant (sorry
)
Andrius,
Yes..
I am not sure I understand.
Hello,
I did automate the process in a vba macro that add a unique count datafield in the pivot, automatically updated when you change the configuration of the pivot.
Let me know your thoughts.
http://lazyvba.blogspot.com/2010/11/improve-your-pivot-table-to-count.html
lazyvba,
I did try your code and it seems to work with my example pivot table!
It converted my data to a table and added new columns, maybe you mentioned that on your website?
Thanks a lot! This solution saved me some hours.
Ben,
Thanks for commenting!
Boss you are genius. Hv been searching this for quite some time.