+ Reply to Thread
Results 1 to 5 of 5

Dynamic Average of Difference Formula

  1. #1
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Dynamic Average of Difference Formula

    I don't write many formulas these days and I'm sure this one is obvious to formula experts, but as usual I can't come up with it. Probably something with offset, address......

    I have a column of numbers. I want to always lookup the last number. I know I can use lookup(9.99 E.... and get that.
    But then I have a cell named period. I want to type a number in that cell and have the dynamic formula average the difference between the last number and the number X cells above that based on the period number.

    Example in spreadsheet.

    Last four numbers. Period number in cell is 4
    69
    65
    64
    62

    Formula looks up last number 62, then based on period finds 69 four cells above it calculates the following (62-69)/4 = -1.75.

    Thanks.
    Attached Files Attached Files
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Dynamic Average of Difference Formula

    Using your posted workbook
    these formulas perform the calculation you're looking for
    Please Login or Register  to view this content.
    Are any of those of interest to you?
    Last edited by Ron Coderre; 07-13-2015 at 02:23 PM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Dynamic Average of Difference Formula

    The first one seems okay with 4, but when I change it to 5, I believe the result should be -1.8 for my sample data, but it returns -1.4. The other two seem okay, so I'm good.

    Thanks for your help.
    Last edited by skywriter; 07-13-2015 at 04:28 PM.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Dynamic Average of Difference Formula

    Oops!
    This formula:
    Please Login or Register  to view this content.
    would need to be something like this:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Dynamic Average of Difference Formula

    That works.

+ 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. [SOLVED] sum() and average() formula with dynamic columns
    By umbata in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-25-2015, 12:29 PM
  2. [SOLVED] average formula for dynamic range
    By rossg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2014, 07:41 AM
  3. Dynamic Range and Average Formula
    By molfetta55 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2014, 09:54 AM
  4. [SOLVED] Formula to average range of cells only if difference between values is no more than 1
    By aaron85w in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-28-2013, 07:12 AM
  5. Replies: 1
    Last Post: 07-13-2012, 06:43 AM
  6. Replies: 10
    Last Post: 11-21-2011, 12:51 PM
  7. Dynamic range in average formula
    By Cicada in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-09-2011, 02:08 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