Consulting

Results 1 to 6 of 6

Thread: PivotTable: CD count not track count.

  1. #1

    PivotTable: CD count not track count.

    Hello friends,

    I need your help. I have the attachment that has a sample of all my songs.
    I want a "pivot table" that would tell me how many albums do I own by Genre then by artist, I keep getting the number of songs instead. Please help me with the following points in mind:
    A. (Col. F) or Genre need to be in "Row labels".
    B. (Col. D) or Artist needs to follow the "A" condition and also needs to be in "Row labels".

    Thank you so much in advance!
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    All I did was add a helper column with a formula of

    =--(COUNTIF($A$1:$B2,$B1(>1)

    and then use a sum aggregate on this column in the pivot table.

    BTW, only 1 Al green album, shame on you. And who is Alan Jackson that warrants 15 albums?
    Attached Files Attached Files
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Hello there! sorry to bother you! I could have sworn that I did and figured the pivot table out due to your post/feedback; I tried to use it, and referred back to your kind attachment.
    But for some reason and when opening your attachment I cant seem to find the solution nor can I seem to have the formula to work. Please help me with the attachment.

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    If you put Albums in the PT Values area, it seems to work
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    thanks Paul, much appreciated. but the results are incorrect. Alan Jackson as an example does not have 149 albums. the pivot here is counting the songs. I am trying to count the number of Albums.
    Help please.

  6. #6
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Ooops - my bad -- missed that part


    Also using a slightly different helper column like XLD's

    Another approach would be to copy the database sheet and then Remove Duplicates. Making the PT off of that would be more straight forward (MHO)

    Both in the attachment
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •