Running total within IF

D

DanielWalters6

Hi, I'm looking for a formula which will add together all of the values from
a range if they are negative... (only if they are negative)
So far, I've used the countif function to count how many positive and
negative results are recorded. - okay for the project at the moment, as
values 1 or -1 or 0 will be entered into system, so counting negative values
is the same thing, however if -3 points is entered into the range, this
obviously doesn't work...

I'm normally okay with excel formulas, just need a little push in the right
direction,

thank you for any help you can provide.
 
P

Pete_UK

Use SUMIF instead of COUNTIF - it has 3 parameters, like this:

=SUMIF(condition_range,"<0",sum_range)

although in your case sum_range might be the same as condition_range, so it
could be omitted and would therefore look very similar to a COUNTIF formula.

Hope this helps.

Pete
 
G

Gord Dibben

=SUMIF(A1:A100,"<0") will return the sum of negatives as negative number

=ABS(SUMIF(A1:A100,"<0")) will return the sum of negatives as positive number


Gord Dibben MS Excel MVP
 
D

DanielWalters6

Thank you all for your help!
I wan'st aware of SUMIF - Was trying to build an IF statement, which if
conditions matched added it to a total variable.

Thank you again

Dan
 

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