I'm trying to write a formula to have one cell add a specific, varying number of cells from a column.
currently all i've figured out is a long if-then statement similar to the following
if a1=1;
then send b1
else if a1=2
then send sum(b1:b2)
else if a1=3
then send sum(b1:b3)
and so forth.
Is there a way to condense this so it's both easier to write and can be extended past the original parameters without going back to extend the code?
In theory the formula I am looking for would work something like this.
find the sum of cells b1-b(x) where x is equal to the integer in cell a1
Bookmarks