How to sum a variable number of items

R

RobinC

How do I sum the first X cells in a list where X is defined in another cell?

Specifically, I have a list of numbers in cells B4:B30.

In cell A1, I have another number, which I want to be able to change around.
So that if A1=4, then I sum B4:B8, but if A1=5, then I sum B4:B9 and so on.
 
Top