+ Reply to Thread
Results 1 to 6 of 6

Pivot table displaying value as percentage of another value

  1. #1
    Registered User
    Join Date
    01-21-2011
    Location
    Dayton, OH
    MS-Off Ver
    Excel 2003
    Posts
    3

    Pivot table displaying value as percentage of another value

    So I've got a script that runs and collects data on all of our data servers. It runs once a week and puts this in a SQL database. I then grab this data with Excel. The header rows are Hostname, DriveName, TotalCapacity, FreeSpace, UsedSpace, and DateScanned. The goal is to be able to show capacity changes from week to week. Now unless we add disk to a server, the totalCapacity field rarely changes for each server, but it does happen.

    What I'd like to do is use a pivot table to show something like.

    Hostname 1/7/2011 1/14/011 1/21/2011
    ServerA
    -C: Drive 50% 51% 51%
    -D: Drive 25% 30% 50%
    -E: Drive 80% 90% 99%
    ServerB
    -C: Drive 50% 51% 55%
    -D: Drive 50% 55% 60%

    Essentially I'd like to display the UsedSpace value as a percentage of the TotalCapacity value, but I can never get it to display properly. It always want's it to base it off a specific cell value, or either previous or next which doesn't work either. Does anyone know how I set this up?

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Pivot table displaying value as percentage of another value

    You can create a used space calculated field (Pivot table menu -> formulas -> calculated field) fairly easily, if you upload a trimmed example of your situation I can walk you through it.
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    01-21-2011
    Location
    Dayton, OH
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Pivot table displaying value as percentage of another value

    Ok here's a small snippet. There is one more field - TempID, but that's just for SQL, you can ignore it completely.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Pivot table displaying value as percentage of another value

    Bit you know:

    Alt, d, p, f
    HostName to row field
    DriveName to row field (inside HostName)
    DateScanned to column field
    --------------

    New bit:
    Pivot table menu -> Formulas -> Calculated Field...
    Name - "UsedPercent" (obviously you can call it what you want, except for names that already exist)
    Double-click UsedSpace
    /
    Double-click TotalCapacity
    OK
    ----

    To set format as percentage:
    Right-click one of the results - e.g. 0.58333
    Field Settings
    Number
    Percentage
    OK

    hth

  5. #5
    Registered User
    Join Date
    01-21-2011
    Location
    Dayton, OH
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Pivot table displaying value as percentage of another value

    Awesome! This is exactly what I was looking for. Thank you so much for the help!

  6. #6
    Registered User
    Join Date
    06-22-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Pivot table displaying value as percentage of another value

    Cheeky Charlie Thank you so much for this solution, I have been cudgelling my brains, added dozens of columns with % to solve a similar problem, but now I found it! THANK YOU MAN!

+ 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.6.0 RC 1