+ Reply to Thread
Results 1 to 8 of 8

Pivot Table Count

  1. #1
    Registered User
    Join Date
    03-09-2016
    Location
    states
    MS-Off Ver
    2003
    Posts
    52

    Pivot Table Count

    Hello

    I would like a pivot table creating with the output shown in the table example sheet

    Does anyone know how to create it?
    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,920

    Re: Pivot Table Count

    You can't do that with a pivot table. You can group and bundle things in row or column headers, but anything in the data grid is going to come out as a number.

    You can use Match / Index to look up text information. If the rows and columns are "static" you can set this up. If the data is dynamic then you will have to use VBA to make the column and row headers and fill in the formulas.
    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
    03-09-2016
    Location
    states
    MS-Off Ver
    2003
    Posts
    52

    Re: Pivot Table Count

    The data would be static.. in that case how would I do this by match/index?

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

    Re: Pivot Table Count

    I put the code in an Excel table. I see by your profile that you have Excel 2003 that does not support tables, but the XLSX file you attached indicates you have at least 2007 which does support tables.

    Tables don't confer a great advantage here as they do in most other programs but is does make it easier to track the columns.

    I added a helper column to the table. What we want to track depends on both the Ref and the code so I made a composite that has the formula: =SUBSTITUTE([@Ref]&":"&[@Code],"#",""). This is the Ref + the Code with a delimiter in between (for easier reading). I had to wrap the SUBSTITUTE around the whole thing because P100 and P002 codes have trailing # but the column headers on the display do not.

    Then we move over to Sheet 1 where we take advantage of INDEX and MATCH: =IFERROR(INDEX(Table_Codes,MATCH($A2&":"&B$1,Table_Codes[Composite],0),2),"")

    I make a composite out of the row and column headers using partial absolute addressing (keep the column static for the Ref and the row static for the code). I use the composite to find the matching row in the table and we want the second column from the table that is on this row. There are a lot of "misses" that would normally evaluate to #N/A, so I "silenced" them with IFERROR.
    Attached Files Attached Files

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Pivot Table Count

    and update your profile about your real excel version (Excel 2003 cannot produce xlsx file)

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Pivot Table Count

    As mentioned above you can't do that with Pivot Table, your source doesn't contain elements what you show in your result tab (headers).
    Because I don't know your Excel version, try this one, done with PowerQuery
    Attached Files Attached Files

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

    Re: Pivot Table Count

    Hi Gerald,

    Would this answer be ok?

    PT Count instead of Text.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  8. #8
    Registered User
    Join Date
    03-09-2016
    Location
    states
    MS-Off Ver
    2003
    Posts
    52

    Re: Pivot Table Count

    Hi Marvin,

    Ideally I want it to pick up the W221 information as i need that information to concatenate later into another table.

+ 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: 05-16-2014, 07:34 PM
  2. Pivot Table Count
    By turlmarq in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-25-2014, 01:41 PM
  3. 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
  4. Pivot Table 0 count value help !!!
    By Smiffy3594 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-30-2013, 04:12 PM
  5. Replies: 2
    Last Post: 02-11-2012, 09:33 PM
  6. pivot table count if
    By spinkung in forum Excel General
    Replies: 1
    Last Post: 10-31-2009, 06:11 AM
  7. Count in Pivot Table
    By waxwing in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-21-2005, 05:06 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