countif programming function

R

RegRat

Would someone please show me how to write an equation to count the number of
entries that meet more than 1 condition. I need to count the number of any
COLOR of "green" with an "Approved" STATUS (answer: 3)? Thanks a bunch,
A B
1 COLOR STATUS
2 Yellowgreen Pending
3 Green Approved
4 Green Pending
5 Bluegreen Approved
6 Red Approved
7 Yellow Approved
8 Green Approved
9 Bluegreen Pending
 
J

John Bundy

Put in a helper column with concantenate which will look like this
GreenApproved
with code like this
=B3&C3
then have your criteria in two seperate columns
=COUNTIF(D3:D9,D2&E2)
green in D2 and Approved in E2

I come back with 2 so are you wanting to get all approved that contain green
anywhere in the name?
 
E

Elkar

If you have more than one criteria, use the SUMPRODUCT function. Try this:

=SUMPRODUCT(--(NOT(ISERROR(SEARCH("green",A1:A8)))),--(B1:B8="approved"))

HTH,
Elkar
 
J

JMB

I think you could eliminate the NOT function call:
=SUMPRODUCT(--ISNUMBER(SEARCH("green",A1:A8)),--(B1:B8="approved"))
 

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