#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default countif

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default countif

Try

=COUNTIF(A:A,"<=" & DATE(2007,1,1))

If this post helps click Yes
---------------
Jacob Skaria


"kakymoau" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default countif

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


"kakymoau" wrote in message
...
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.



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
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF Q John Excel Worksheet Functions 4 June 6th 05 07:05 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 12:40 AM.

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"