Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Count entries in a range that match a certain criteria within datavalidation.

Hi,

On cells D1:D50, each cell has a list of several options to choose.
(Used Data-Validation-Allow-List, Source="Apple, Orange,Grape,Nop-
Apple,Nop-Orange,Nop-Grape")

So on each cell I can choose of the options available in the source
field.
I need to be able to count all the cells in the range D1:D50 that
contain the first three letters "Nop"

I tried Sumproduct function but it either gives zero or a #value error
and countif if using it like this : =COUNTIF(D1:D5, "=Nop-Apple"),
but I want something like this =COUNTIF(D1:D50, LEFT(D1:D50,3)="Nop"))
which of course doesnt work
Can someone help with this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Count entries in a range that match a certain criteria within data validation.

Try this:

=COUNTIF(D1:D50, "Nop*")

--
Biff
Microsoft Excel MVP


wrote in message
...
Hi,

On cells D1:D50, each cell has a list of several options to choose.
(Used Data-Validation-Allow-List, Source="Apple, Orange,Grape,Nop-
Apple,Nop-Orange,Nop-Grape")

So on each cell I can choose of the options available in the source
field.
I need to be able to count all the cells in the range D1:D50 that
contain the first three letters "Nop"

I tried Sumproduct function but it either gives zero or a #value error
and countif if using it like this : =COUNTIF(D1:D5, "=Nop-Apple"),
but I want something like this =COUNTIF(D1:D50, LEFT(D1:D50,3)="Nop"))
which of course doesnt work
Can someone help with this?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Count entries in a range that match a certain criteria within datavalidation.

=countif(d1:d50,"nop*")

if you wanted to use =sumproduct() (don't do this!)
=sumproduct(--(left(d1:d50,3)="nop"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

" wrote:

Hi,

On cells D1:D50, each cell has a list of several options to choose.
(Used Data-Validation-Allow-List, Source="Apple, Orange,Grape,Nop-
Apple,Nop-Orange,Nop-Grape")

So on each cell I can choose of the options available in the source
field.
I need to be able to count all the cells in the range D1:D50 that
contain the first three letters "Nop"

I tried Sumproduct function but it either gives zero or a #value error
and countif if using it like this : =COUNTIF(D1:D5, "=Nop-Apple"),
but I want something like this =COUNTIF(D1:D50, LEFT(D1:D50,3)="Nop"))
which of course doesnt work
Can someone help with this?

Thanks


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Count entries in a range that match a certain criteria withindata validation.

Thanks for the help.

I got it working with SUMPRODUCT((D1:D50<"")*(LEFT(D1:D50,3)="Nop"))
I swear that I tried it before and it didnt work, but now it does... I
said it before, will say it again, Sumproduct frustrates me to no end.

But I like the =COUNTIF(D1:D50, "Nop*") better, it is simpler and
easier to work with. Thanks Valko.

Dave, your help is as usual appreciated and very instructive. I like
sumproduct alot but it takes me awhile to get it working. Go figure.
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
Count if two columns match different criteria Curt D. Excel Worksheet Functions 5 May 14th 23 07:44 PM
Count of entries meeting criteria Karen McKenzie Excel Worksheet Functions 2 January 21st 08 02:38 PM
How to count dates within a certain range in a column with mutiple date range entries Krisjhn Excel Worksheet Functions 2 September 1st 05 01:59 PM
I Need to Count Number of Entries Based on Two Criteria Jones Excel Worksheet Functions 3 July 14th 05 10:34 PM
count no. of entries in range for a day DeeJay30 Excel Worksheet Functions 1 June 22nd 05 08:47 AM


All times are GMT +1. The time now is 07:29 PM.

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

About Us

"It's about Microsoft Excel"