+ Reply to Thread
Results 1 to 5 of 5

? Variable Ranges ? how to change address in Formula range base on another cell value ?

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    7

    ? Variable Ranges ? how to change address in Formula range base on another cell value ?

    I think my question is about Variable Ranges in a Formula.

    I take several motorcycle trips every summer, ranging in length to 60 days.
    Rows for each of 60 potential Days, and lots of Columns for stuff like miles, rain, hours, etc

    below the 60th Day/Row are rows of formulae for Each Column like Min, Average, Max, etc

    For a short 10 day trip - I just fill in the data on the top 10 rows and IGNORE the rest of the rows.
    So I have to edit the formulae for the Last Day/Row Number so they only include the relevant 10 days.
    (lots of complex reasons, not evident in this simplification, why just deleting the unused rows will not work.)
    For example: =AVERAGE(B1:B10)

    I want to just change one cell value (in this example to 10) and thus all formulae would calculate rows 1 thru 10.

    For example:

    =AVERAGE(B1:B,MysteryFormula(cell-address-with-Last-Row-Number))

    everything I try keeps return text not address
    and, of course, B and MysteryFormula have to be combined into an Address

    thanks, Bob

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: ? Variable Ranges ? how to change address in Formula range base on another cell value

    Like this...

    To sum column B, B1:B10...

    A1 = 10

    =SUM(B1:INDEX(B:B,A1))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: ? Variable Ranges ? how to change address in Formula range base on another cell value

    Try

    =AVERAGE(B1:INDEX(B:B,D1))

    Where D1 is the cell holding the last row #

  4. #4
    Registered User
    Join Date
    01-27-2014
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: ? Variable Ranges ? how to change address in Formula range base on another cell value

    you guys are both right - works great - even when I apply your syntax to much more complex formulae with multiple uses of INDEX

    thanks, Bob

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: ? Variable Ranges ? how to change address in Formula range base on another cell value

    You're welcome. We appreciate the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Variable range SUM , base range on other column blank cells?
    By stevnb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-20-2012, 10:55 AM
  2. Variable Address Ranges
    By pncd2 in forum Excel General
    Replies: 1
    Last Post: 12-14-2005, 01:10 PM
  3. [SOLVED] how to use a cell value as the base for the name of a variable
    By Ian B in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2005, 07:05 AM
  4. Change cell address in formula
    By Maxwell Russell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-07-2005, 05:40 PM
  5. Change cell address in formula
    By Maxwell Russell in forum Excel General
    Replies: 0
    Last Post: 01-07-2005, 05:15 PM

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