ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum Number of Rows based on Value in Another Cell (https://www.excelbanter.com/excel-worksheet-functions/249605-sum-number-rows-based-value-another-cell.html)

Dickie Worton

Sum Number of Rows based on Value in Another Cell
 
Hi,

Not sure that the subject line described what I want to do very well, I know
that there is a long-winded way of doing what I want to do, but at the same
time I know there must be a quicker and better way, so here goes.

I'd like to to able to write a formula that will sum a number of rows, so as
to create a 'year to date' column in my spreadsheet.

I've put an example of what my worksheet contains below, and put simply I'd
like the YTD column to be a sum of the values in column B, e.g. the YTD value
for month 2 should be the sum of months 1&2, the YTD value for month 4 should
be the sum of months 1-4, etc.

A B C
Month Value YTD
1 100 100
2 150 250
3 75 325
4 100 425

As I said, I know I could write a slightly different formula in each cell of
Coumn C to achieve this, but I'm sure there must be a more efficient way,
i.e. I want to create a formula for this column in cell C1 and copy it down
into the other 11 rows, so that I have year to date values for each month.

Am I missing something, or just being dumb? I feel sure there's an easy way
to do this and I just don't know what it is.

Any help greatly appreciated as always...






Bernard Liengme

Sum Number of Rows based on Value in Another Cell
 
In C2 enter =SUM($B$2:B2) this will give 100
Double click B2's fill handle (small solid square in lower right corner) to
copy this down the column
Now you have the sums needed
Not the $s in $B$2 cause it to remain unchanged as you copy the formula -
call "absolute reference"
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Dickie Worton" wrote in message
...
Hi,

Not sure that the subject line described what I want to do very well, I
know
that there is a long-winded way of doing what I want to do, but at the
same
time I know there must be a quicker and better way, so here goes.

I'd like to to able to write a formula that will sum a number of rows, so
as
to create a 'year to date' column in my spreadsheet.

I've put an example of what my worksheet contains below, and put simply
I'd
like the YTD column to be a sum of the values in column B, e.g. the YTD
value
for month 2 should be the sum of months 1&2, the YTD value for month 4
should
be the sum of months 1-4, etc.

A B C
Month Value YTD
1 100 100
2 150 250
3 75 325
4 100 425

As I said, I know I could write a slightly different formula in each cell
of
Coumn C to achieve this, but I'm sure there must be a more efficient way,
i.e. I want to create a formula for this column in cell C1 and copy it
down
into the other 11 rows, so that I have year to date values for each month.

Am I missing something, or just being dumb? I feel sure there's an easy
way
to do this and I just don't know what it is.

Any help greatly appreciated as always...







Dickie Worton

Sum Number of Rows based on Value in Another Cell
 
Hi Bernard,

That's exactly what I wanted, thank you very much.

I knew the answer would be fiendishly simple, and it was, but I just
couldn't think of it!

Kind regards,

Dickie

"Bernard Liengme" wrote:

In C2 enter =SUM($B$2:B2) this will give 100
Double click B2's fill handle (small solid square in lower right corner) to
copy this down the column
Now you have the sums needed
Not the $s in $B$2 cause it to remain unchanged as you copy the formula -
call "absolute reference"
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Dickie Worton" wrote in message
...
Hi,

Not sure that the subject line described what I want to do very well, I
know
that there is a long-winded way of doing what I want to do, but at the
same
time I know there must be a quicker and better way, so here goes.

I'd like to to able to write a formula that will sum a number of rows, so
as
to create a 'year to date' column in my spreadsheet.

I've put an example of what my worksheet contains below, and put simply
I'd
like the YTD column to be a sum of the values in column B, e.g. the YTD
value
for month 2 should be the sum of months 1&2, the YTD value for month 4
should
be the sum of months 1-4, etc.

A B C
Month Value YTD
1 100 100
2 150 250
3 75 325
4 100 425

As I said, I know I could write a slightly different formula in each cell
of
Coumn C to achieve this, but I'm sure there must be a more efficient way,
i.e. I want to create a formula for this column in cell C1 and copy it
down
into the other 11 rows, so that I have year to date values for each month.

Am I missing something, or just being dumb? I feel sure there's an easy
way
to do this and I just don't know what it is.

Any help greatly appreciated as always...






.



All times are GMT +1. The time now is 02:58 PM.

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