+ Reply to Thread
Results 1 to 4 of 4

Time difference average between values in pivot table

  1. #1
    Registered User
    Join Date
    06-27-2014
    Location
    Comillas, Spain
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Time difference average between values in pivot table

    Hi!

    I'm trying to find the DIFFERENCE average between values in the same row in a pivot table:

    For example:

    A159:37
    A1610:38
    A1712:37
    A1813:04
    A1913:45
    A2014:05
    A2114:56
    A2215:14
    A2315:40
    A2416:32
    A2516:36
    A2618:29
    A2719:37
    A2819:44

    The simple formula for calculating this manually would be =AVERAGE(A16-A15,A17-A16,A18-A17,A19-A18…A28-A27)

    The problem I have is that the data is in the first row (Row Labels) of a Pivot Table, which cannot be copied and pasted on the worksheet or workbook because the data on this pivot table will get larger everyday.

    My closest approach to this problem has been the array formula: {=AVERAGE(OFFSET(A15:A27,1,)&-A15:A27)} which seems to be calculating what I need but for some reason returns the usual #VALUE! error.

    I posted the solution (if calculated manually) on cell G4. Other cells have all the unsuccessful approaches I have taken.

    Anyone that can help me with this?
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Time difference average between values in pivot table

    welcome to the forum, javi-xls. maybe an array formula like this?
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    you can use a bigger range for the red portion.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    06-27-2014
    Location
    Comillas, Spain
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: Time difference average between values in pivot table

    Wow thanks a lot benishiryo! Worked like a charm!

    Could you explain to me shortly how the height and width parameters affect the OFFSET formula? I have a fairly decent understanding of the formula but this part of it completely throws me off.

    Thank you very much! You saved me a ton of work and head-scratching

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Time difference average between values in pivot table

    you're very welcome.

    height is basically the number of rows you want to range up, & width is the number of columns. for eg.

    =OFFSET(A1,0,0,4,6)
    this will range up A1:F4. it means from A1, move 0 rows, 0 columns, 4 rows high, 6 rows wide. to know what range it refers to, try:
    1. putting numbers in those range. and use a sum
    =SUM(OFFSET(A1,0,0,4,6))
    2. press CTRL + G & paste the formula in the reference box. it will select the range when you click OK.

    i used COUNT to count how many numbers there are in the range. i minus one to remove a number. cause it's always 2nd number to the last number minus 1st number to the 2nd last number.

    hope that helps. do mark it as Solved if it does
    =)

+ 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. Formatting a time difference to work in a pivot table
    By dan_fash in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-22-2014, 10:28 AM
  2. [SOLVED] Pivot table with years on columns. I cant calculate a difference in values
    By Daniel_da6 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-17-2013, 12:13 PM
  3. Pivot Table with Ordinal Values and percentage difference
    By algebr in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-21-2013, 01:09 AM
  4. Pivot Table Logon/Logout Time Difference
    By MMcGuinness in forum Excel General
    Replies: 0
    Last Post: 08-31-2011, 07:28 AM
  5. Replies: 0
    Last Post: 06-13-2006, 10:30 AM

Tags for this Thread

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