Using the SUM Formula

  • Thread starter Thread starter John Persico
  • Start date Start date
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?
 
=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))
 
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
 
Back
Top