complex CountIf situation

R

rtraut

I want to count the cells in a given column that meet a certain condition if
the cells in the same row of another column also meet that condition.

Here's a more specific example:

I want to count the cells in K:K where K# > 90 and P# = "E", "I", "O", "R",
or "S"

I thought this would do it:
=COUNTIF(J:J,AND(J:J>90,OR(P:p="e",P:p="I",P:p="o",P:p="r",P:p="S"))) , but
that is returning a value of 0 (it should result in 19)

Thanks for any help in advance!
 
L

Luke M

=SUMPRODUCT(--(K2:K200>90),--ISNUMBER(SEARCH(P2:p200,"E I O R S")))

Note that SUMPRODUCT needs to have arrays of equal size, and you can't
callout the entire column unless using XL 2007.
 
T

T. Valko

=SUMPRODUCT(--(K2:K200>90),--ISNUMBER(SEARCH(P2:p200,"E I O R S")))

NB: That'll count empty cells in P if K meets the criteria.
 
R

rtraut

Thanks Luke, something is still wrong though. I changed the ranges from k200
and p200 to k2500 and p2500, respectively. There are 19 occurences of a
number > 90 in k2:k2500 where the corresponding cell in p2:p2500 has a value
of either E, I, O, R, or S. For some reason the formula that you provided is
coming back with a value of 82. I set a custom filter on column K for
"greater than 90" and counted all of the occurences of E I O R and S in
column P. Only 19. Am I missing something?
 

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

COUNTIF Function 1
Nesting Problem 1
Counting different colums 1
averaging averages? 5
lookup function bringing in wrong info 8
Select Case in a Change Event 6
COUNTIF date formula 3
countif 3

Top