Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 183
Default Count cells with a date in them

Hello,
I would like to count cells in a column that have dates in them -any date, I
do not want to count cells with text or anything that's not a date.
I'm trying to use a countif, but I don't know how to write the criteria of a
date.
Thank you,
Caroline
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 320
Default Count cells with a date in them

a date to excel is a serial number, FORMATTED as a date. You can try
something like this:
=SUMPRODUCT(N(YEAR(A1:A100)=2001),N(YEAR(A1:A100) <=2010))
to count the number of values which fall between 2001 and 2010, but a value
of 39868, for example, will be counted, since that's the serial# for today.
HTH - Bob Umlas - Excel MVP

"Caroline" wrote in message
...
Hello,
I would like to count cells in a column that have dates in them -any date,
I
do not want to count cells with text or anything that's not a date.
I'm trying to use a countif, but I don't know how to write the criteria of
a
date.
Thank you,
Caroline



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 183
Default Count cells with a date in them

Bob, this formula returns a #value? but I used the serial number in my
countif and that works for me.
Thank you!

"Bob Umlas" wrote:

a date to excel is a serial number, FORMATTED as a date. You can try
something like this:
=SUMPRODUCT(N(YEAR(A1:A100)=2001),N(YEAR(A1:A100) <=2010))
to count the number of values which fall between 2001 and 2010, but a value
of 39868, for example, will be counted, since that's the serial# for today.
HTH - Bob Umlas - Excel MVP

"Caroline" wrote in message
...
Hello,
I would like to count cells in a column that have dates in them -any date,
I
do not want to count cells with text or anything that's not a date.
I'm trying to use a countif, but I don't know how to write the criteria of
a
date.
Thank you,
Caroline




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Count cells with a date in them

Remember, as Bob was pointing out, no Excel spreadsheet function can tell if
a cell is a date or a number if that number is between 0 and 2,958,465 - the
date range supported by Excel.

If you column only has dates, blanks, or text, no numbers then

=COUNTIF(A1:A100,"=0")

You can write your own VBA function to do this:

Function CountDates(R As Range)
For Each cell In R
If IsDate(cell) Then
Total = Total + 1
End If
Next cell
CountDates = Total
End Function


--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Caroline" wrote:

Bob, this formula returns a #value? but I used the serial number in my
countif and that works for me.
Thank you!

"Bob Umlas" wrote:

a date to excel is a serial number, FORMATTED as a date. You can try
something like this:
=SUMPRODUCT(N(YEAR(A1:A100)=2001),N(YEAR(A1:A100) <=2010))
to count the number of values which fall between 2001 and 2010, but a value
of 39868, for example, will be counted, since that's the serial# for today.
HTH - Bob Umlas - Excel MVP

"Caroline" wrote in message
...
Hello,
I would like to count cells in a column that have dates in them -any date,
I
do not want to count cells with text or anything that's not a date.
I'm trying to use a countif, but I don't know how to write the criteria of
a
date.
Thank you,
Caroline




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 cells that contain a date that is not a Sunday Marcel Marien Excel Discussion (Misc queries) 11 November 10th 06 02:38 PM
Count cells within a date range Dewayne Excel Discussion (Misc queries) 7 August 20th 06 04:40 AM
Count cells between a date range BradKopecky Excel Worksheet Functions 2 February 13th 06 08:57 PM
Count number of cells with date <today's date Cachod1 New Users to Excel 2 January 28th 06 02:37 AM
count the number of cells with a date <= today's date Cachod1 New Users to Excel 3 January 27th 06 09:14 PM


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

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"