+ Reply to Thread
Results 1 to 8 of 8

pivot table - count of different values

  1. #1
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    pivot table - count of different values

    I have a sheet that is set up with these columns:

    There are 4 different sales categories that a client can purchase products from. Some clients purchase multiple products from the same category.

    I need to report on the average # of sales categories each client buys from. So while a client could have 6 rows each indicating SalesCategory "A" I want it to show me that they only buy from 1 category. So the Max # that should show up in my report would be 4.

    Because the clients vary and are added to monthly, I thought a Pivot Table would be the way to do this, but it's counting every product the client buys...so in the example above, the client is showing a 6 under SalesCategory A.

    How can I get this to just show me how many DIFFERENT items in SalesCategory a client buys from?

    I've attached an example.
    Sample Product per Client.xlsx

  2. #2
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    696

    Re: pivot table - count of different values

    Remove the Grand Totals of Rows & Colums using Pivot Table Options and use count function to get the total of row and column.

  3. #3
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    Re: pivot table - count of different values

    I'm not sure I'm understanding. I removed the Grand Totals, but I had already had a count function in the pivot table and it's still showing me, for example, Client A has 5 products under SalesCategoryA but I only want it to show 1.

  4. #4
    Forum Contributor
    Join Date
    06-18-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    142

    Re: pivot table - count of different values

    I added a column called SalesCategoryCount to your data and used this formula

    Please Login or Register  to view this content.
    starting in cell D1 and copying down. It works for 100 rows...you can adjust formula to as many rows as needed.

    Once this is here, you can use the sum of the SalesCategoryCount data in your pivot table to get the info to look like you wanted.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    Re: pivot table - count of different values

    Thank you!

  6. #6
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    Re: pivot table - count of different values

    Quote Originally Posted by jjhayes View Post
    I added a column called SalesCategoryCount to your data and used this formula

    Please Login or Register  to view this content.
    starting in cell D1 and copying down. It works for 100 rows...you can adjust formula to as many rows as needed.

    Once this is here, you can use the sum of the SalesCategoryCount data in your pivot table to get the info to look like you wanted.

    How can I change this to R1C1 format? I'm having a tough time getting it right.

    I came up with this but it doesn't seem to be working

    Please Login or Register  to view this content.
    Last edited by kmlloyd; 10-05-2015 at 02:19 PM.

  7. #7
    Forum Contributor
    Join Date
    06-18-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    142

    Re: pivot table - count of different values

    To translate my formula to R1C1, and assuming that our first formula is in Row 2, Column 4, with Column 4 being SalesCategoryCount, then this code should work, copied from Row 2, Column 4 downwards.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    Re: pivot table - count of different values

    Hmm it's still not working, but I think it's an issue in my VBA...I'll post in that forum. Thanks!!

+ 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. How to count distinct values from table in pivot table
    By gopijadhav in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-04-2014, 07:14 AM
  2. Pivot Table help! add values instead of count occurences
    By ruthjames in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-26-2013, 03:23 PM
  3. [SOLVED] Count unique values in pivot table
    By katy1985 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 06-19-2013, 06:51 AM
  4. [SOLVED] count unique values in pivot table
    By Fugazi_Dent in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2013, 11:58 AM
  5. [SOLVED] Count only unique values in pivot table
    By Leahmaria26 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2013, 08:56 PM
  6. Count Specific values in a Pivot Table
    By rmikulas in forum Excel General
    Replies: 5
    Last Post: 09-10-2010, 10:01 AM
  7. Count unique values in pivot table
    By karinos57 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-10-2009, 12:03 PM
  8. [SOLVED] Count unique values - Pivot Table
    By Thomas Mueller in forum Excel General
    Replies: 3
    Last Post: 11-03-2005, 08:10 PM

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