+ Reply to Thread
Results 1 to 5 of 5

Count unique values in pivot table

  1. #1
    Registered User
    Join Date
    03-20-2013
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    17

    Count unique values in pivot table

    Is there a way to count unique values in a pivot table? I want to determine if a batch code of stock has more than one expiry date (which it shouldnt) so if the pivot counted more than one it would highlight an error?
    Last edited by katy1985; 06-19-2013 at 06:45 AM.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Count unique values in pivot table

    If I understand your question, the answer is yes....that is exactly what PT do....depending how your data is set up....can you upload a "clean" set of data?....thanks....
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    03-20-2013
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Count unique values in pivot table

    Sorry i dont think ive explained very well...

    If my data looks something like this:

    N028 B1002B02 31-Jul-2013 96
    N028 B1002B02 31-Aug-2011 16
    N028 B1002B02 31-Aug-2011 32

    I want to produce a pivot by batch number (B*****) and sell by date so it only shows the 2 differnet dates. At the minute, if i pivot this it will show:

    B1002B02 3

    Because theres 3 dates, but i want it show 2 because there are only 2 different dates?

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Count unique values in pivot table

    you would need to use the PowerPivot add-in which can create a distinct count-regular pivot tables (still!) cannot do that. or add a formula to the raw data to calculate the distinct count
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Count unique values in pivot table

    Or add a column to your data source containing =1/countif($a$1:$a$100,$a1) where col A contains the batch numbers.
    Include this column in the PT in the Data field using sum.If the result of a batch number is larger than 1 it is not unique ( you will have to round the reults probably)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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