Conditional Range w/Sum

V

Vlad

Ok..I've been trying to bang out a formula that will essentially do a sum on
a variable range within a certain column--Column A. The range will be
determined by a value in another column--Column B. Example: If the value in
cell B1 is between 1-2, the formula sums cells A1 and A2 and returns the
value to, say, cell C2. Any advice on how to set up this kind of variable
range (for lack of a better term) within a formula would be greatly
appreciated.
 
B

Bernie Deitrick

In C2, you could use the formula:

=SUM(INDIRECT("A1:A" & B1))

So if B1 were 3, you would get the sum from A1:A3.

HTH,
Bernie
MS Excel MVP
 
Top