+ Reply to Thread
Results 1 to 13 of 13

Excel 2007 : Pivot Table unique values

  1. #1
    Registered User
    Join Date
    01-17-2011
    Location
    Easton MD
    MS-Off Ver
    Excel 2003
    Posts
    5

    Unhappy Pivot Table unique values

    I have a very large data source from which I create Pivot Tables.
    When I ask for a Count (of names), the Pivot Table does not count Unique values, but counts each individual entry. How can I get it to summarize the unique values?
    Last edited by penny.rhine; 01-17-2011 at 05:02 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Pivot Table unique values

    Can you give an example of what you mean?

    Are there any slight differences? Like extra spaces, etc...?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-17-2011
    Location
    Easton MD
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Pivot Table unique values

    No, that i would understand. I am dealing with a list of customers and policy numbers which are repeated. The data is exported from my SQL database to Excel.
    I need to know how many customers/policies are represented in a certain time frame - and i can't figure out how to get that number.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Pivot Table unique values

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Pivot Table unique values

    Can you not alter the SQL export to provide distinct data? If not, you will need an additional formula column in the source data for the pivot.
    Remember what the dormouse said
    Feed your head

  6. #6
    Registered User
    Join Date
    01-17-2011
    Location
    Easton MD
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Pivot Table unique values

    Attached is sample data and pivot table.
    As you can see, the pivot is not counting unique values - the total number of rows in the data is the total Insured on the pivot table
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-17-2011
    Location
    Easton MD
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Pivot Table unique values

    RomperStomper - if you look at the sample, you will see there is distinct data - and many duplications in names of insured.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Pivot Table unique values

    As pointed out by Romperstomper, see attached with some helper columns added...

    the first 2 columns concatenate the Division and respective Insured/Policy columns (this is the next 2 columns can use simple formulas)..

    Then next 2 columns use countifs to decide the unique records.. with formulas:

    =IF(COUNTIF(M:M,M2)=1,1,0)

    and

    =IF(COUNTIF(N:N,N2)=1,1,0)

    Then the Pivot Table Sums these columns...
    Attached Files Attached Files

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Pivot Table unique values

    You need an additional formula like in the attached. There is no way to do it inside the table.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-17-2011
    Location
    Easton MD
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Pivot Table unique values

    i'll try that, Thanks for your help.

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Pivot Table unique values

    Hi penny.rhine

    I think you need to create another table where you have deleted duplicates in the fileds you are counting. In 2003 Excel there is not a "delete dupilicate" function built in. In the newer version you can delete duplicate records from your table based on selected fields (column names) of your data. I believe you need the 2003 Add-In or a newer version to accomplish your task.

    or

    Above you said you have the SQL data on your own. Perhaps you can do a SQL "Select Distinct" command to get the recordset you need before you do Excel on it? See http://www.w3schools.com/sql/sql_distinct.asp

    or

    Maybe some of the smart gurus have a method.
    I see I'm a little late on my answer.
    Last edited by MarvinP; 01-17-2011 at 01:58 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Pivot Table unique values

    I am not so smart though...

    My formulas don't work as they are... they should be:

    =IF(COUNTIF(M$2:M2,M2)=1,1,0)

    and

    =IF(COUNTIF(N$2:N2,N2)=1,1,0)

    copied down.
    Attached Files Attached Files

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Pivot Table unique values

    Hi penny.rhine, you have marked this thread solved and you gave me rep comments (thanks) indicating that you found another way around the problem due to the fact you have over 60,000 records (and I guess our formulas were lagging).

    If you could kindly supply your solution, it would be appreciated as it will help any future users with same issue to get the most effective answer.

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1