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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Countif more than 1 criteria FAQ 68-4725 1

Status
Not open for further replies.

cjjn

Technical User
Jun 2, 2004
35
CA
Hello
I looked in the FAQs before posting and found a great one 68-4725. I just have a further question if anyone can help.

What if I want to do basically a counta - with a condition?
I only want it to count the cells that have been entered into - that do NOT = 0.

Any ideas?

TIA
 
Hi, cjjn. Thanks for taking the time to look at the FAQs before posting.

->I only want it to count the cells that have been entered into - that do NOT = 0

It works just like the examples in the FAQ, but use "<>" instead of "=". <> is how you express "not equal to".

Hope that helps.

[tt]_____
-John
[/tt]Help us help you. Please read FAQ181-2886 before posting.
 
Thanks John

Sorry - I do not think I explained myself very well.
Right now I am using countif <> 0. This works great - however it will count the null cells too because they do not =0 either.

The way I read the FAQ is that the criteria would be in 2 different columns. I need it to only look in 1.

Example
2
2
0
""
""
I would want to look in all 5 cells and get the result of 2.

Thanks again,
Christy
 
OK, I was thinking that your criteria were broken out into two or more columns. This is even easier!

If you will never have negative values, you can just use
[COLOR=blue white]=countif(A:A,">0")[/color]

If you will have both positive and negative values in the range, then you can use
[COLOR=blue white]=countif(A:A,"<0")+countif(A:A,">0")[/color]

[tt]_____
-John
[/tt]Help us help you. Please read FAQ181-2886 before posting.
 
Thanks!
Wow that was a simple solution - I should have thought about what I was doing before looking for a complicated answer. [upsidedown]

Thanks so much for your time.

cj
 
Glad to help, cj. I often over-complicate problems before realizing there is a simple solution, so I know where you're coming from.
[cheers]

[tt]_____
-John
[/tt]Help us help you. Please read FAQ181-2886 before posting.
 
John,

Have a star! I love the simple solutions!

Thanks and best regards,
-Lloyd
 
Thanks, Lloyd. Shiny pointy things are always appreciated!

[tt]_____
-John
[/tt]Help us help you. Please read FAQ181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top