Adding the contents of "x" number of cells.

M

Menochez

So I have a column of randomly created numbers that I need to use for
financial predictions. I need to be able to say: Add from the first cell to
the "x" number of cells.

i.e:
A
Random numbers: Project for: 3
1 3435
2 4234
3 4467
4 2321
5 1234 Then it will add, A1, A2, A(x), where x is 3

I hope I'm clear enough.
I will greatly appreciate your help.
 
O

OssieMac

Assume that the values to be summed start in cell A1 and the 3 is in cell C1
then you could use the following formula:-
=SUM(INDIRECT("A1:A"&C1))

In the above formula would be a replacement for the following:-
=SUM(A1:A3)

However, if the range to be summed starts on a row greater than 1 and you
still want to sum 3 rows then you would have to add a number to the value in
C1. Assume that the values to be summedstart at cell A10 then the formula
would be:-
=SUM(INDIRECT("A10:A"&C1+9))
 
T

T. Valko

Another one:

C1 = 3

=SUM(A1:INDEX(A1:A100,C1))

If C1 is empty the formula will calculate the entire range.
 
D

Dana DeLouis

Just another method. Assuming your list starts in A1, with C1 holding
the number of cells to Sum.

=SUM(OFFSET(A1,0,0,C1,1))

= = =
HTH :>)
Dana DeLouis
 
M

Menochez

Thank you! Works perfectly.

OssieMac said:
Assume that the values to be summed start in cell A1 and the 3 is in cell C1
then you could use the following formula:-
=SUM(INDIRECT("A1:A"&C1))

In the above formula would be a replacement for the following:-
=SUM(A1:A3)

However, if the range to be summed starts on a row greater than 1 and you
still want to sum 3 rows then you would have to add a number to the value in
C1. Assume that the values to be summedstart at cell A10 then the formula
would be:-
=SUM(INDIRECT("A10:A"&C1+9))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top