Using the SUM Formula

J

John Persico

How do I create a formula that adds from the top of a column?
Here's the situation.

I have a column of numbers (with a header of "Pay").
To the right of that colum I want to keep a running total ("Yearly Total").
Every time I get paid, I'm going to enter the amount in the pay column and
then I want the Yearly Total column to automatically add it.
When I create a fomula (say =SUM(B2:B21)), and propigate it down, it doesn't
start at the top. In others words the next formula is =SUM(B3:B22). I want
it to be =SUM(B2:B22). And, if a value is not filled in on the Pay column I
want the Weekly Total to be blank. I only want it activate if there's a
value for Pay. I guess I would have to use a conditionally formula as well,
right?
 
P

Peo Sjoblom

=IF(A21="","",SUM($B$2:B22))


copied down

of course you can put it in the 2 row as well


=IF(A2="","",SUM($B$2:B2))
 
R

Roger Govier

Hi John

You would need to anchor your top cell by making it Absolute, $B$2,
which means it won't change as you copy down.
However, this is an inefficient formula in terms of XL processing and
you would be better to use column C with a formula of

=N(C1)+B2
and copy down
 

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