Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COUNTIF formula against 2 conditions 1

Status
Not open for further replies.

ccepaulb

Technical User
Jan 29, 2004
89
US

I want to calculate a weighted average of sales.
To do this I thought I'd need to write a COUNTIF fromula that counts cells that contain values greater than or less than zero.
The problem is that I can not get the formula to work. I had to write two seprate COUNTIF fromulas; one that counts the cells with values greater than zero and one that counts values less than zero.
Is there a way to write one COUNTIF fromula that says "count the cells that contain values greater than or less than zero"?

Thanks, Paul
 
=COUNTIF(A1:A10,">0")+COUNTIF(A1:A10,"<0")



[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
or

=COUNTIF(A1:A3,"<>0")

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 

That was so easy that I did not even think of it!

Thanks, Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top