• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Evaluating a function in the criteria field of DCOUNT / COUNTIF

Imsy

New Member
Hi,


I have a spreadsheet which contains dates in range B2:B100.


In the cell C2, I need to get the count of cells, in range B2:B100, which have dates in a given month, say 8.


The limitations are that I cannot add a separate column wherein I get the months using formula MONTH(..) and then use a COUNTIF with this new column as the range, to get the count of cells matching 8.


Please reply asap.


Regards,

Imsy
 
Hi, Imsy!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about questions in general...


If you haven't performed yet the search herein, try going to the topmost right zone of this page (Custom Search), type the keywords used in Tags field when creating the topic or other proper words and press Search button. You'd retrieve many links from this website, like the following one(s) -if any posted below-, maybe you find useful information and even the solution. If not please advise so as people who read it could get back to you as soon as possible.


And about this question in particular...


Try using this:

=SUMAPRODUCTO((MES(B2:B100)=8)*1) -----> in english: =SUMPRODUCT((MONTH(B2:B100)=8)*1)


Regards!
 
Hello Imsy,


I would recommend to use TEXT function. Using of MONTH will give incorrect results if you have blank cells in the range & looking for month January. Because excel thinks blank cells as 1/0/1900.


=SUMPRODUCT((TEXT(B2:B100,"m;;")="8")+0)


3 semi-colons will hide blank & zero values. You could also use "mmm;;" & check it like "Jan","Feb" etc...
 
Back
Top