countif array formula

R

Rita

I am using a formula
=COUNT(IF(($N$2:$N$4000="NAX")*($M$2:$M$4000>9)*($M$2:$M$4000<15),$M$2:$M$4000))
which tallies all entries in the range M2:M4000 that are NAX and between
10-14 value. Now I need to change NAX to be a wildcard so that it can count
NAA, NAE, NAX, NAH etc with a value between 10-14. I have tried
=COUNT(IF(($N$2:$N$4000="NA?")*($M$2:$M$4000>9)*($M$2:$M$4000<15),$M$2:$M$4000)) but that doesn't work. Please help.
 
P

Peo Sjoblom

First of all, no need for your ctrl + shift & enter formula, yopu might as
well use

=SUMPRODUCT(--(N2:N4000="NAX"),--(M2:M4000>9),--(M2:M4000<15))

instead of the count formula, to get the equivalent of the wild card you
can use

=SUMPRODUCT(--(LEFT(TRIM(N2:N4000),2)="NA"),--(M2:M4000>9),--(M2:M4000<15))

Regards,

Peo Sjoblom
 
H

Harlan Grove

Peo Sjoblom said:
First of all, no need for your ctrl + shift & enter formula, yopu might as
well use

=SUMPRODUCT(--(N2:N4000="NAX"),--(M2:M4000>9),--(M2:M4000<15))

If it's all hardcoded, might as well use

=SUMPRODUCT(--(N2:N4000="NAX"),--((M2:M4000-12)^2<9))

to provide identical functionality, but if the OP really means between 10
and 14 inclusive, better to use

=SUMPRODUCT(--(N2:N4000="NAX"),--((M2:M4000-12)^2<=4))
instead of the count formula, to get the equivalent of the wild card you
can use

=SUMPRODUCT(--(LEFT(TRIM(N2:N4000),2)="NA"),--(M2:M4000>9),
--(M2:M4000<15))

Does the OP want, e.g., NAPALM, NAVY or NAUSEOUS to be matches as well?
Using a wildcard match like "NA?" is pretty clear that col N matches should
have only 3 chars, otherwise "NA*" would make more sense. So safer to use

=SUMPRODUCT(--(LEN(N2:N4000)=3),--(LEFT(N2:N4000,2)="NA"),
--((M2:M4000-12)^2<=4))
 

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

Simple Question Complicated Formula 1
Formula Count dates multiple criteria 3
Array Formula Help 0
formula 1
Double CountIF 5
Array Formula Assistance 3
Array Formula Help 1
Array Formula Help 2

Top