+ Reply to Thread
Results 1 to 13 of 13

Thread: Pivot Table Headache

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    Perth Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Pivot Table Headache

    Hey so i've been teaching myself excel and have managed to knock up a nice pivot table but have run into what may be a bit of n00b roadblock.
    Basically the data i get would be something like the following columns
    UNIQUE ID POSITION TITLE DEPARTMENT LOOKUP CODE GENDER(M/F)


    Using these columns I turn the lookup code into POSITION GROUP and create an MALE (1 if gender is M else 0) and FEMALE(1 if gender is F else 0)

    So the pivot table columns would be:
    DEPARTMENT- overall filter
    POSITION GROUP- First row label
    POSITION TITLE - Second row label
    Count of UNIQUE ID- Value
    Sum of MALE- Value
    Sum of FEMALE- Value

    This seems to work ok and displays the total number of men then the total number of women for each job title within each position group
    But my problem is once i have the totals for male and female I need to have a percentage field next to each for percentage male vs female

    This is what i really can't get my head around I would think i could create a duplicate column for each and then a percentage of function when displaying it but what do i choose it to be a percentage of in that case???

    Any advice would be greatly appreciated!
    Feel free to flame if this is a retarded question :P

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    W Europe
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    448

    Re: Pivot Table Headache

    Hi

    could you possibly post a sample of your data / Pivot Table?

    Edit your post - Click " Go Advanced" - Click the Paperclip and follow the wizard
    Cheers - THE WARNING I RECEIVED WAS NOT JUSTIFIED

  3. #3
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,150

    Re: Pivot Table Headache

    Hello,

    this would be much easier to understand if you could upload a workbook with some sample data, not real data, dummy data, please.

    I can't even figure out if DEPARTMENT LOOKUP CODE is three columns or two, and in case it's two, is it [DEPARTMENT] [LOOKUP CODE] or [DEPARTMENT LOOKUP] [CODE] ??

    So, make it easy for us to help you. Post a workbook.

    cheers,

  4. #4
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Pivot Table Headache

    I agree that a workbook would help though you may simply be able to set the male/female fields to display as percentage of row.
    Good luck.

  5. #5
    Registered User
    Join Date
    02-08-2012
    Location
    Perth Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Pivot Table Headache

    Its [Department] [LookupCode] Sorry it looked better before the spaces wee formatted out :S
    Will upload an example as soon as i have access to excel again, currently working on my tablet

  6. #6
    Registered User
    Join Date
    02-08-2012
    Location
    Perth Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Pivot Table Headache

    Example.xlsx
    OK so attached should be some dummy data
    the way i see it if i'm gonna add a percentage it'll have to be in the pivot table itself as otherwise i can't see how you could filter by department

  7. #7
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Pivot Table Headache

    It is easier to add the Gender field as column headers and skip your added fields. See the attached, assuming that is what you wanted.
    Attached Files Attached Files
    Good luck.

  8. #8
    Valued Forum Contributor Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds/Sheffield, England
    MS-Off Ver
    Excel 2003
    Posts
    1,031

    Re: Pivot Table Headache

    Ok you need to create a calculated field with the formula of =MALE/(MALE+FEMALE)

    Unfortunately I've no idea how to do this in '07, it's a lot different to '03
    Click the * below to say thanks

    Girls sleep with guys who use photoshop, but marry the ones who work with Excel

    Corduroy
    pillows: They're making headlines!

    Did you mean: recursion
    http://www.google.com/search?hl=en&q=recursion

  9. #9
    Registered User
    Join Date
    02-08-2012
    Location
    Perth Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Pivot Table Headache

    Quote Originally Posted by OnErrorGoto0 View Post
    It is easier to add the Gender field as column headers and skip your added fields. See the attached, assuming that is what you wanted.
    The problem with this is that there are quite a few fields that i need to do this to and I can't have them being broken down too much. Unless there is a way to add 2 Column labels that reference the same row labels but that dont effect each other???

  10. #10
    Valued Forum Contributor Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds/Sheffield, England
    MS-Off Ver
    Excel 2003
    Posts
    1,031

    Re: Pivot Table Headache

    Have a look at calculated fields, they add a lot of flexibility
    Click the * below to say thanks

    Girls sleep with guys who use photoshop, but marry the ones who work with Excel

    Corduroy
    pillows: They're making headlines!

    Did you mean: recursion
    http://www.google.com/search?hl=en&q=recursion

  11. #11
    Registered User
    Join Date
    02-08-2012
    Location
    Perth Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Pivot Table Headache

    Calculated fields are one of the main things I don't understand about pivot tables. Can anyone suggest a good tutorial? the ones i have found have been quite unhelpful.

    Thank you all again for your patience

  12. #12
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Pivot Table Headache

    Quote Originally Posted by mlayer View Post
    The problem with this is that there are quite a few fields that i need to do this to and I can't have them being broken down too much. Unless there is a way to add 2 Column labels that reference the same row labels but that dont effect each other???
    I am probably being dim but I do not really follow this. Have you tried Kyle's suggestion?

    If I recall correctly, calculated fields are on the Formulas button in the Pivot Table Tools tab. They are not that complicated - you just have to remember that the fields are always aggregated before the operations are applied, so for example if you add one that is Field1/Field2, then for each total, what you get is Sum(Field1)/Sum(Field2) and not Sum(Field1/Field2)
    Good luck.

  13. #13
    Registered User
    Join Date
    02-08-2012
    Location
    Perth Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Pivot Table Headache

    Quote Originally Posted by OnErrorGoto0 View Post
    I am probably being dim but I do not really follow this. Have you tried Kyle's suggestion?

    If I recall correctly, calculated fields are on the Formulas button in the Pivot Table Tools tab. They are not that complicated - you just have to remember that the fields are always aggregated before the operations are applied, so for example if you add one that is Field1/Field2, then for each total, what you get is Sum(Field1)/Sum(Field2) and not Sum(Field1/Field2)
    I am currently trying to work out Kyle's solution, I was replying to your earlier post.
    Ive done a calculated field that references the male and female columns and it seems to work but i have to test it with more data. It could just be me being paranoid but I don't understand why it works :S
    already much better than I had before though thanks guys!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0