Count entries in a range that match a certain criteria within datavalidation.

H

HammerJoe

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
 
D

Dave Peterson

H

HammerJoe

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.
 

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