Two criteria for CountIf?

G

Guest

I have two columns of cells that need to be evaluated and determine if the
criteria are met in order to be included in a count. The first column needs
to have something other than "Closed" and the second column and row should
contain something other than null/blank. Is there a simple way to include
both criteria in a single statement to allow a count of the rows?
 
A

aidan.heritage

=SUMPRODUCT(--(A1:A3<>"closed"),--(NOT(ISBLANK(B1:B3))))

replace A1:A3 and B1:B3 with the appropriate ranges
 
G

Guest

Try:

=SUMPRODUCT(--(A1:A100<>"Closed"),--(B1:B100<>""),--(B1:B100<>" "))

Sumproduct must have a range (rather than a column)

HTH
 
B

Bob Phillips

=SUMPRODUCT(--(A1:A100<>"Closed"),--(TRIM(B1:B100)<>""))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
G

Guest

Thank you for the reply.
I am not trying to achieve the product of a sum, rather get a count of rows
that have something other than the string "closed" and a value other than
blank in the second column. The Countif function seems to be similar to what
I need, however, it is only allowing me to specify criteria for one column at
a time. This is not allowing both criteria to be checked and validated.
An example would be like:
columnA columnB
closed 2100
closed
unknown 500
The last row would be counted and give a return of 1.
 
G

Guest

Bill, the formula that Toppers gave you will return 1, its work.

as sumproduct return 1 and 1*1=1 it will sum how many 1's do you have in
your range, working like a countif.

hope it helps
Regard from Brazil
Marcelo

"DB_Bill" escreveu:
 
G

Guest

Thank you for the help. After looking at the replies more closely I realized
what was happening in the solutions given.
 

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

Similar Threads


Top