ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Adding the contents of "x" number of cells. (https://www.excelbanter.com/excel-worksheet-functions/213606-adding-contents-x-number-cells.html)

Menochez

Adding the contents of "x" number of cells.
 
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.



OssieMac

Adding the contents of "x" number of cells.
 
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))


--
Regards,

OssieMac


"Menochez" wrote:

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.



T. Valko

Adding the contents of "x" number of cells.
 
Another one:

C1 = 3

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

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

--
Biff
Microsoft Excel MVP


"Menochez" wrote in message
...
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.





Dana DeLouis

Adding the contents of "x" number of cells.
 
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


Menochez wrote:
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.



Menochez

Adding the contents of "x" number of cells.
 
Thank you! Works perfectly.

"OssieMac" wrote:

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))


--
Regards,

OssieMac


"Menochez" wrote:

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.




All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com