Sum Number of Rows based on Value in Another Cell

D

Dickie Worton

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...
 
B

Bernard Liengme

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
 
D

Dickie Worton

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
 

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