+ Reply to Thread
Results 1 to 9 of 9

Modified Average Formula

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Modified Average Formula

    There are 15 stocks in column D:R. I am trying to calculate the % change between row 2 and 3 for ever example and then take the average of those averages. I demonstrated what the formula should perform in row 6. Is there a way to embed all of these caluclations into one formula?
    Attached Files Attached Files
    Last edited by rhudgins; 12-10-2010 at 03:34 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Modified Average Formula

    One way:

    =AVERAGE((D3:R3-D2:R2)/D2:R2)

    confirmed with CTRL+SHIFT+ENTER not just ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Modified Average Formula

    should you be averaging averages?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Modified Average Formula

    Is there another way to do this without CTRL+SHIFT+ENTER?

  5. #5
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Modified Average Formula

    The reason I ask because I will need to extend the column range to V and at this time there are no values in those cells but there will be over time

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Modified Average Formula

    I guess this would do it too..

    =SUMPRODUCT(AVERAGE(--(D3:R3-D2:R2)/D2:R2))

    or

    =INDEX(AVERAGE(--(D3:R3-D2:R2)/D2:R2),0)

  7. #7
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Modified Average Formula

    Neither of those work. S2:V3 are all blank cells so the formula is trying to divide a blank cell by a blank cell and is therefor returning #DIV/0!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Modified Average Formula

    The sample you gave didn't imply that blanks would be there, not even you original formula took that into account, please be sure to qualify the questions fully beforehand.

    =AVERAGE(IF(D2:R2<>"",(D3:R3-D2:R2)/D2:R2))

    confirmed with CSE...

    I can't get a working non-CSE formula...

  9. #9
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Modified Average Formula

    Thanks this works now. Sorry for the confusion.

+ 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