countif

K

kakymoau

I have a column with 3 years worth of random dates (2006, 2007, and 2008)
with the data is set up as Date. I want to count the number of date before
1/1/2007. I am using countif(C4:C299,">=1/1/2007"), the return value is 0.
When i do countif(C4:C299, "9/13/2006"), it does result in a correct value.
Only when i use < or > sign then the software won't count. Any suggestion?
Thanks for your input.
 
F

figdatbong

Presumably you have a cell in your worksheet that holds the date condition
(this can be entered into cell A1 using =DATE(2006,1,1) or whatever date you
need to test). If your random dates i.e. 2006, 2007 etc are indeed numbers
then the following formula should do the trick.

=COUNT(IF(yourdaterange<YEAR(A1),yourdaterange,""))

This should be entered as an array formula.

Hope this helps

Regards

Paul
 

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


Top