+ Reply to Thread
Results 1 to 8 of 8

How can I show the difference between two columns in a Pivot Table

  1. #1
    Forum Contributor
    Join Date
    03-12-2004
    Posts
    147

    How can I show the difference between two columns in a Pivot Table

    I have a pivot table that uses about 40,000 rows of time-stamps for the source data. The pivot table then has a column to find the "Min" time and a second column to find the "Max" time from the source data.

    I want to have a 3rd column that shows the elapsed time between min and max time.... not sure how to accomplish this.

  2. #2
    Forum Contributor
    Join Date
    03-15-2005
    Location
    North Carolina
    MS-Off Ver
    2003 & 2007
    Posts
    180
    Hi,
    You can do this by going into the PivotTable options (On PivotTable Bar) and select Formulas-->Calculated Field.

    Type in your column heading in the Name Box. Then in the Formula box put something like:

    = 'Max Time' - 'Min Time'

    Add it which will put it in the PivotTable Field list and in your PivotTable.

    HTH
    jtp

  3. #3
    Forum Contributor
    Join Date
    03-12-2004
    Posts
    147
    Not sure I follow...

    The field list contains the column "M_Time". In the pivot table I dragged that in twice. Once to convert to "min", once to convert to "Max".

    I followed your directions, I named my field "elapsed"
    then used the formula:

    "Max of M_Time" - "Min of M_Time"

    The results all come out "#VALUE!".

    Any tips? What am I doing wrong?

  4. #4
    Forum Contributor
    Join Date
    03-15-2005
    Location
    North Carolina
    MS-Off Ver
    2003 & 2007
    Posts
    180
    Did you use " around the Max of M_Time and Min of M_Time? It should be ='Max of M_Time' - 'Min of M_Time'

  5. #5
    Forum Contributor
    Join Date
    03-12-2004
    Posts
    147
    Ok, I tried using the single quotes instead of double, but now it says there is an error in my formula.

    For the record:

    Original column name: M_TIME

    I dragged this into the pivot table twice, converted one to Min, one to Max. The exact names are:

    Max of M_TIME2
    Min of M_TIME

    I tried the following formulas:

    'Max of M_TIME2' - 'Min of M_TIME'
    'Max of M_TIME' - 'Min of M_TIME'

    both say error on formula when I click ok

  6. #6
    Forum Contributor
    Join Date
    03-15-2005
    Location
    North Carolina
    MS-Off Ver
    2003 & 2007
    Posts
    180
    Hmm when you create the formula, I would just select from the Field list below it. Double-Clicking them will automatically insert them into the formula box. That way you know you have the field name correct.

  7. #7
    Forum Contributor
    Join Date
    03-12-2004
    Posts
    147
    The field list only allows me to add the original column, before the Min and Max are calculated...

  8. #8
    Registered User
    Join Date
    08-04-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: How can I show the difference between two columns in a Pivot Table

    Hi Guys

    Has anyone got an answer to this exact problem as I have the same issue; DataSout has a Time field; in the pivot I created two columns MINTIME and MAXTIME.

    How do I subtract MINETIME from MAXTIME?

    Help!!!

+ 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