+ Reply to Thread
Results 1 to 6 of 6

Count Specific values in a Pivot Table

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    Roanoke, VA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Question Count Specific values in a Pivot Table

    Hi all!!

    I have a table that includes 4 different types of data, Work Order #, Area, Date and Service Code. The problem is for each Work Order #, there is only 1 entry for Area, 1 entry for Date, but MANY entries for Service Codes for each work order.

    I am trying to count the number of times a specific Service Code appears throughout the table of data, and then be able to break it down by Area.

    I have the columns headers listed as the following: Work Order #, Area, Date, Service Code 1, Service Code 2, etc all the way to Service Code 12.

    Example: the Service Code "AA” is listed for most Work Orders, but in all different columns. I need to count how many times "AA" shows up in each Area.


    I have attached an example file, with example date.

    Thank you all for your help in advance, you guys are so wonderful!

    P.S. One of my coworkers suggested this might be done better in MS Access, but unfortunately I don't know ANYTHING about Access, so I’m hoping this can be done in Excel because I'm much more familiar with that program.
    Attached Files Attached Files
    Last edited by rmikulas; 09-10-2010 at 10:01 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count Specific values in a Pivot Table

    My idea would be to append columns to your database labels with each service code... then apply formula to count the number of times each code appears in each row..then base Pivot table on those.

    For example

    Label P1 as "AA" (without quotes) and Q1 as "XW" and so on

    Then in P2 use formula:

    =COUNTIF($D2:$O2,P$1)

    copied down the database and over as many columns as you have unique codes.

    Then drag those to the pivot table and sum the numbers up.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-07-2010
    Location
    Roanoke, VA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Count Specific values in a Pivot Table

    Thanks! I tried that and it works! Thank you so much, before I was trying to use the formula HLOOKUP and putting in on another sheet, but it wasn't working. Thank you so much for your help!!

  4. #4
    Registered User
    Join Date
    07-07-2010
    Location
    Roanoke, VA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Count Specific values in a Pivot Table

    Ok... so it didn't quite work out perfect like I thought. The formula works GREAT with service codes that are 2 letters. Example AA or OV etc.

    But having a problem with the code on the Service Codes that are "<?" or "T*" or "<:" they seem not to be counting correctly.

    Any suggestions on how to search for those symbols??



    Thanks again for the help.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count Specific values in a Pivot Table

    Sorry, didn't think about that and didn't test...

    Try this formula instead:

    =SUMPRODUCT(--($D2:$O2=P$1))

    copied down and across.

  6. #6
    Registered User
    Join Date
    07-07-2010
    Location
    Roanoke, VA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Count Specific values in a Pivot Table

    PERFECT!!! I converted the formula to my actual data, and spot checked it and it works PERFECTLY!!!

    Thank you so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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