+ Reply to Thread
Results 1 to 5 of 5

Varying a cell reference in a formula

  1. #1
    Registered User
    Join Date
    01-06-2009
    Location
    Keswick, Virginia, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Varying a cell reference in a formula

    I am trying to identify some combination of formulas or functions that will allow me to adjust the cell reference within a function based on a value in another cell.

    For example, I have a series of values listed from cell C50 to cell W50. I want to use a function to calculate the internal rate of return over a range of the cells: =IRR(C50:W50)
    So far, so good.

    However, I want the size of the range to be determined by a value entered in another cell, let's say B2. If the value in cell B2 is "5", I would want the formula to consider only the first five columns: =IRR(C50:G50). If the value in cell B2 is "10", I would want the formula to consider only the first ten columns: =IRR(C50:L50).

    Any suggestions?
    Thanks!
    Last edited by bgbeamer; 01-07-2009 at 10:09 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Try =IRR(offset(C50, 0, 0, 1, b2)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613
    A simple sol'n Using a helper cell, say H1, let H1=
    Please Login or Register  to view this content.
    to build the actual range of cells to evaluate, then use
    Please Login or Register  to view this content.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    01-06-2009
    Location
    Keswick, Virginia, USA
    MS-Off Ver
    Excel 2007
    Posts
    5
    shg,
    It seems to be working.

    ProtonLeah,
    I haven't tried your suggestion, opting for the direct approach already suggested, but I will keep it in mind.

    Thanks for the help!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    If you need enough of these that is slows your workbook down, it could be changed to use INDEX (which is not volatile) instead of OFFSET (which is).

+ 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