sumif with >or< condition

W

Will Fleenor

I have 6 numbers in cells a1..a6. Some are positive and some are negative.
I would like to total up only the numbers that are > 20000 or <-20000.
This formula works for >
=SUMIF(A1:A6,">"&20000,A1:A6)
but this formula will not work:
=SUMIF(A1:A6,or(">"&20000,A1:A6,"<"&-20000),A1:A6 )
What is wrong with the last formula. It always evaluates to 0.

Thanks Will
 
P

Pete_UK

You can only have one condition with SUMIF. Try this:

=SUMIF(A1:A6,">"&20000,A1:A6)+SUMIF(A1:A6,"<"&-20000,A1:A6)

Hope this helps.

Pete
 
G

Guest

I got it to work with this:

=SUM(IF(ABS(A1:A6)>20000,A1:A6))

Activate with CTRL SHIFT ENTER
 
R

RagDyeR

One more:<g>

=SUM(SUMIF(A1:A6,{">20000","<-20000"}))

--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

Of course, add the 0's:

=SUMPRODUCT(((A1:A6>20000)+(A1:A6<-20000))*A1:A6)
 
B

Bob Phillips

Yet one more

=SUMPRODUCT(--(ABS(A1:A20)>2000),A1:A20)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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