Google Answers Logo
View Question
 
Q: variable range names in Excel ( No Answer,   1 Comment )
Question  
Subject: variable range names in Excel
Category: Computers > Software
Asked by: joemeth-ga
List Price: $2.00
Posted: 20 Jun 2006 11:00 PDT
Expires: 20 Jul 2006 11:00 PDT
Question ID: 739702
I want to turn a cell location in a the range definition in an MS
Excel function into a variable so that I can test a number of
alternative results.  For example, in the funtion

=average(a1:a30)

I'd like to the "a30" or only the "30" to refer to another cell, like
b1 so that if I change the value in b1 to say "a60" or "60" I can
change the range length in the function to

=average(a1:a60)

I plan to use this in order to do some tests on alternative moving
averages of a series of values to see which produces the best results.
Answer  
There is no answer at this time.

Comments  
Subject: Re: variable range names in Excel
From: anhebetude-ga on 21 Jun 2006 15:28 PDT
 
I believe that you can achieve your desired result with the OFFSET
function, which returns a range and accepts cell references as inputs.

Taking your example of column A containing the data and using B1 as
the cell in which you input the desired range (30, 60, etc.), the
following formula should accomplish your task.

=AVERAGE(OFFSET(A1,0,0,B1,1))

I hope this helps,

anhebetude

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy