1

I've got a simple range based formula

=SUM(A3:A$5)

I would like to dynamically assign the range value in the formula by referencing another cell's value, for example

cell B1 = 3 and cell B2 = 5

=SUM(A<referenced value from B1>:A$<referenced value from B2>)

Is it possible?

2 Answers 2

2

Yes, use the INDIRECT function

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

Note: I haven't tested this formula, let me know if there are any problems

3
  • =SUM(INDIRECT("A"&B1&":A"&C1)) yep Oct 17, 2014 at 11:27
  • I don't see C1 referenced?
    – CallumDA
    Oct 17, 2014 at 12:06
  • It's what I used Oct 17, 2014 at 12:07
2

Using INDEX works too.

=SUM(INDEX(A:A,B1):INDEX(A:A,B2))

Referencing an earlier answer which suggests using this method instead of INDIRECT.

1
  • Maybe, I did something wrong with your solution. That didn't help me. I did look for an existing answer, but somehow I've overlooked the earlier answer you have referenced. Thanks
    – ITL
    Oct 17, 2014 at 12:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .