Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rita
 
Posts: n/a
Default countif array formula

I am using a formula
=COUNT(IF(($N$2:$N$4000="NAX")*($M$2:$M$40009)*($ 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$40009)*($ M$2:$M$4000<15),$M$2:$M$4000)) but that doesn't work. Please help.
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
better to use sUMPRODUCT. Try (non-array entered):
=SUMPRODUCT(--(LEFT($N$2:$N$4000,2)="NA"),--($M$2:$M$40009),--($M$2:$M$4000<""))

Also see:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
Regards
Frank Kabel
Frankfurt, Germany

Rita wrote:
I am using a formula
=COUNT(IF(($N$2:$N$4000="NAX")*($M$2:$M$40009)*($ 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$40009)*($ M$2:$M$4000<15),$M$2:$M$4000))
but that doesn't work. Please help.



  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

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

=SUMPRODUCT(--(N2:N4000="NAX"),--(M2:M40009),--(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:M40009),--(M2:M4000<15))

Regards,

Peo Sjoblom

"Rita" wrote:

I am using a formula
=COUNT(IF(($N$2:$N$4000="NAX")*($M$2:$M$40009)*($ 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$40009)*($ M$2:$M$4000<15),$M$2:$M$4000)) but that doesn't work. Please help.

  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

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

=SUMPRODUCT(--(N2:N4000="NAX"),--(M2:M40009),--(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:M40009),
--(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))


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an EXCEL COUNTIF formula for a range of values Pat Walsh Excel Discussion (Misc queries) 5 January 21st 05 02:57 PM
Need help troubleshooting an array formula XLXP on Win2K KR Excel Worksheet Functions 1 December 13th 04 07:41 PM
What instead of an array formula part 2 Reg Besseling Excel Discussion (Misc queries) 2 December 10th 04 07:35 AM
What instead of an array formula? Reg Besseling Excel Discussion (Misc queries) 3 December 6th 04 01:55 PM
How do I create a formula in Excel that will countif or sumif bef. bkclark Excel Worksheet Functions 4 November 10th 04 05:30 PM


All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"