View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kim Kim is offline
external usenet poster
 
Posts: 284
Default Counting date occurances

I tried it and got a invalid procedure name

"Mike H" wrote:

Kim,

You could use a UDF.

Alt + F11 to open VB editor
Right click 'This Workbook' and insert module and paste this in

Function countdates(rng As Range)
For Each c In rng
If IsDate(c) Then countdates = countdates + 1
Next
End Function

Call from a worksheet cell with
=countdates(A1:A20)

Where A1:A20 is the range you want to check for dates.

Mike

"Kim" wrote:

I have two columns P and R that contain both date information and numbers. I
want to count everytime a date is entered in the cell. Example

Apr-31 16-May
5 2
25-May 3
4 23-Jul

Does anyone know how I can do this?