+ Reply to Thread
Results 1 to 4 of 4

Count percentage in Pivot table using two Count column

  1. #1
    Registered User
    Join Date
    08-12-2019
    Location
    Singapore
    MS-Off Ver
    2021
    Posts
    18

    Count percentage in Pivot table using two Count column

    How to count percentage in Pivot table using two Count columns.

    I'm using "=Yes/'Variable ' ", but I get error. Please help.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Count percentage in Pivot table using two Count column

    You ran into one of the "quirks" of pivot tables. They will yield a number if you count nonnumerical data. Unfortunately, you can't use this number in calculations.

    So, you have to play with the source data. I added two helper columns to your source data:
    Var Count =1
    Yes Count =IF([@Yes]="Yes",1,0)

    The first formula simply assigns 1 for each variable. The second formula is 1 if the value is YES and zero otherwise. I calculated the percentages off the helper columns.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    08-12-2019
    Location
    Singapore
    MS-Off Ver
    2021
    Posts
    18

    Re: Count percentage in Pivot table using two Count column

    Quote Originally Posted by dflak View Post
    You ran into one of the "quirks" of pivot tables. They will yield a number if you count nonnumerical data. Unfortunately, you can't use this number in calculations.

    So, you have to play with the source data. I added two helper columns to your source data:
    Var Count =1
    Yes Count =IF([@Yes]="Yes",1,0)

    The first formula simply assigns 1 for each variable. The second formula is 1 if the value is YES and zero otherwise. I calculated the percentages off the helper columns.
    Thank you very much! It's working.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,291

    Re: Count percentage in Pivot table using two Count column

    FWIW you could also do it in Power Pivot by loading the data into the data model then creating simple counta measures for each then another measure that just divides those two. See attached.
    Attached Files Attached Files
    Remember what the dormouse said
    Feed your head

+ 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. Replies: 1
    Last Post: 08-31-2020, 11:54 PM
  2. Count below #*Column in Pivot Table
    By elbrujo in forum Excel General
    Replies: 6
    Last Post: 05-17-2019, 11:00 AM
  3. [SOLVED] Pivot for Count and count result as percentage of another cell
    By JEA_123 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-22-2015, 07:54 AM
  4. pivot table - sum as percentage of count
    By forkedtoro in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-11-2013, 01:14 PM
  5. Replies: 3
    Last Post: 06-12-2013, 10:53 PM
  6. Replies: 4
    Last Post: 09-15-2010, 08:45 PM
  7. Replies: 1
    Last Post: 02-09-2010, 06:16 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