+ Reply to Thread
Results 1 to 10 of 10

Setting dynamic range in a formula

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Question Setting dynamic range in a formula

    Hi,
    I have a column of numbers and I want the following array formula to always use the last 12 entries:
    =(PRODUCT(1+D1:D12/100)-1)*100
    Any suggestions?
    Thanks,
    Phillycheese5

    P.S.
    Last question today :-)

  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
    What do you want the ultimate formula to do with the last 12 entries?

    Add them?
    Average them?

    Ron

  3. #3
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223
    I want it to be the range for the formula I listed which is a geometric linking fomula. I can't use the GEOMEAN because it ignors negative returns.

  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
    This formula returns the range of the last 12 entries, which you can hopefully use:

    =OFFSET(INDIRECT("D"&SUMPRODUCT(MAX(((D1:D50)<>"")*(ROW((D1:D50)))))),-11,,12)

    Note: It does not check for blanks. If finds the last entry and returns the last 12 cells ending in the location of the last entry. If you need the last actual non-blank entries, let me know.

    Does that help?

    Ron

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    In your array formula, my formula would be this:

    =(PRODUCT(1+OFFSET(INDIRECT("D"&SUMPRODUCT(MAX(((D1:D50)<>"")*(ROW((D1:D50)))))),-11,,12)/100)-1)*100

    Committed with [Ctrl]+[Shift]+[Enter]

    Is that what you're looking for?

    Ron

  6. #6
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223
    Ron,
    It's very close...and I'm not sure how to tweak it...
    The last 12 returns I have are these:
    1.40%
    -5.26%
    -3.87%
    2.04%
    3.91%
    4.01%
    2.77%
    0.44%
    -1.06%
    2.31%
    -3.72%
    4.66%
    which links for a cumulative of 7.23, and the formula you provided yields 7.63.
    Not sure where the difference is...the returns only go out 2 decimals, so it's not rounding.
    I really appreciate the help.
    Phillycheese5

+ 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