+ Reply to Thread
Results 1 to 9 of 9

Is it possible to add duration field in pivot table?

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Is it possible to add duration field in pivot table?

    Hi,
    I want to add a field ,"duration" and calculate duration between Start Date and End Date in pivot table.
    Is it possible in pivot table?
    If possible, how can I do that?

    Thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Is it possible to add duration field in pivot table?

    Yes, you can add CALCULATED FIELDS to a pivot table.

    1) Create the pivot
    2) Select it
    3) PivotTable Tools > Options > Fields, Items & Sets > Calculated Field

    Name: Duration
    Formula: =End - Start (select the correct field names)

    4) Now you can add this newly created field to you Pivot table results like any other field.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Is it possible to add duration field in pivot table?

    Thanks.
    I got the raw data and in this raw data , I got Date field. This is timesheet for workers.
    I used Date in the Value field to get Min and Max function in pivot.
    So, in the pivot table, I have Start Date and End Date in value field. In this case, can't I use ?

    Or, could you tell me other way to calculate duration beside pivot?
    I am looking up sumif function. Do you think this is good?

    Thanks

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Is it possible to add duration field in pivot table?

    I'm a little lost. Post a workbook with a SMALL subset of desensitized data showing some of this info and the Pivot you have created from this small data set. Point out there what you're trying to add and I'll take a look.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Is it possible to add duration field in pivot table?

    Here it is.
    Thanks
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Is it possible to add duration field in pivot table?

    Gotcha! I see the problem. Yes, Pivot Tables do not inherently allow creation of the =MAX(Date) - MIN(Date) syntax, it just shows zeros everywhere.

    But you can install a powerful addon for Excel 2010 (free) called PowerPivot which adds even more wonderful pivoting tools, and that is amongst them.

    https://www.youtube.com/watch?v=lE2OAPh-Zf8

  7. #7
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Is it possible to add duration field in pivot table?

    I am going to give my Excel Template to other users to use.
    Are they need to install Power Pivot too to use?

    Thanks

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Is it possible to add duration field in pivot table?

    Yes. Anyone with Excel 2010 or great should install it.

  9. #9
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Is it possible to add duration field in pivot table?

    I mean they have to install to use my template? otherwise they get an error??
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. add a duration column in pivot table
    By Goodstart14 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2015, 10:03 AM
  2. [SOLVED] A pivot table field calculated using other field values as fields?
    By chrisf78 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-07-2015, 03:08 AM
  3. [SOLVED] Referring to a Sub-Field on Calculated Field Pivot Table Column?
    By figo12 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-27-2014, 02:02 PM
  4. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  5. Replies: 3
    Last Post: 03-03-2012, 12:16 PM

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