[AccessD] OT - Specifying Excel Ranges

Stuart McLachlan stuart at lexacorp.com.pg
Thu Dec 14 15:54:12 CST 2006


On 14 Dec 2006 at 12:09, Hale, Jim wrote:

> Check out the indirect function. For example
> =AVERAGE(INDIRECT(A5):INDIRECT(A6)) where cell A5 has "C4" and cell A6 has
> "C7"  (ie, text but without the quotes) works the same as =AVERAGE(C4:C7).
> A5 and A6 can then be changed to whatever cell numbers you need. Jim Hale

Indirect is very powerful, you can  make the original problem even simpler 
and only haver to change  a single number when the size of the range 
changes with something like:

=SUM(C4:INDIRECT("C" & A1 + 3))
Then you just need to store the number of values in A1.

If the value of A1 is "4", this is the same as =SUM(C4:C7),

-- 
Stuart





More information about the AccessD mailing list