+ Reply to Thread
Results 1 to 2 of 2

How to define a range of cells, by two variables?

  1. #1
    Registered User
    Join Date
    11-08-2011
    Location
    CA, US
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question How to define a range of cells, by two variables?

    My apology if this questions has been asnwered before (or if this is something trivial):

    The question is, how to define a range of cells, by two variables?

    Example:

    I want to calculate the average of the values in the cells AVG = AVERAGE(A5:A9), based on the two values (5 and 9) listed as "Start Column" and "End Column":


    When I change the value of "End Column" to 13, the result should be AVG = AVERAGE(A5:A13)


    Thanks,

    Ron

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: How to define a range of cells, by two variables?

    Welcome to the forum.

    These sorts of variations will do the trick, where StartValue is 5 and EndValue is 13.

    =AVERAGE(INDEX(A:A,StartValue):INDEX(A:A,EndValue))

    =AVERAGE(INDIRECT("A"&StartValue&":A"&EndValue))
    Hope that helps,

    Colin

    RAD Excel Blog

+ 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