+ Reply to Thread
Results 1 to 14 of 14

Counting the number of unique numbers in a pivot

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Counting the number of unique numbers in a pivot

    Hello,

    I cannot get my pivot table to count unique instances of a PO number. Instead it counts how many times a PO appears.

    The attachment shows a sample of raw data and the result I want along with the result I am getting.

    I have tried using the data model option in excel 13 but when I do that it will not SUM my spend, an error message tells me it is in text.


    Can you help?
    Attached Files Attached Files
    Last edited by bigsi1984; 11-02-2016 at 05:40 AM. Reason: To add attachment

  2. #2
    Registered User
    Join Date
    10-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Counting the number of unique numbers in a pivot

    That looks a bit muddled. Here you go

    Attachment 487299

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,416

    Re: Counting the number of unique numbers in a pivot

    You've just discovered one of the many quirks about this forum...

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Registered User
    Join Date
    10-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Counting the number of unique numbers in a pivot

    Thanks,

    I have sorted the attachment now.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,416

    Re: Counting the number of unique numbers in a pivot

    In B15, this array formula, copied down:

    =SUM(IF(FREQUENCY(IF($D$4:$D$10=A15,$A$4:$A$10),IF($D$4:$D$10=A15,$A$4:$A$10))>0,1))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Counting the number of unique numbers in a pivot

    Hi,

    Using Power Pivot in Excel 2010 works as expected- I have attached your workbook with the pivot added. You may be able to simply upgrade the model to see it in 2013.
    Attached Files Attached Files
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  7. #7
    Registered User
    Join Date
    10-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Counting the number of unique numbers in a pivot

    I don't appear to have power pivot. It is not listed in my COM add-ins.

    Your sheet works as I want it to but when I try it on my actual data set I still get the an error trying to SUM anything in the values box. It says it is not a supported calculations for text data types

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Counting the number of unique numbers in a pivot

    Are you sure that your cost data is not actually stored as text rather than a true number value?

  9. #9
    Registered User
    Join Date
    10-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Counting the number of unique numbers in a pivot

    It's currently stored as accounting but I have tried copying the whole set into a new workbook and paste special values then reformatted the columns to number and I still get the error message.

  10. #10
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Counting the number of unique numbers in a pivot

    If you alter the number format of the cells, do the displayed values actually change appearance?

  11. #11
    Registered User
    Join Date
    10-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Counting the number of unique numbers in a pivot

    Yes. So they are currently account so showing £xx.xx and number will show them as xx.xx

  12. #12
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Counting the number of unique numbers in a pivot

    Does it perchance make a difference if the numbers are formatted in a non-accounting format before they are loaded into the data model?

  13. #13
    Registered User
    Join Date
    10-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Counting the number of unique numbers in a pivot

    I have been playing around with it and I figured out the problem. The spend cell uses and IF statement to work out the cost so it's always seen as text. I have fixed this to be a standard formula and everything works fine. The problem now is that I cannot group the months together in the data model! I think without power pivot this is not possible.

  14. #14
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Counting the number of unique numbers in a pivot

    You can always add month and year columns to the source data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Counting number of unique numbers based on another variable.
    By uradox in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 05-02-2014, 12:22 AM
  2. [SOLVED] Counting Unique numbers in a list
    By Notters in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2013, 12:38 PM
  3. Replies: 5
    Last Post: 07-22-2013, 05:56 PM
  4. Need help counting the unique digits ina list of numbers
    By bigtraing in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-10-2013, 08:50 AM
  5. Counting unique numbers
    By aresquare1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-11-2013, 07:18 AM
  6. Counting Unique Numbers in List
    By ssmith0011984 in forum Excel General
    Replies: 1
    Last Post: 03-10-2010, 02:11 PM
  7. Counting unique numbers
    By maxnpj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-13-2009, 11:42 PM

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