Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kim Kim is offline
external usenet poster
 
Posts: 284
Default Counting date occurances

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?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Counting date occurances

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?

  #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?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Counting date occurances

Kim,

I can't replicate this error. Where does the error message occur and what
does it say in the worksheet cell where you have entered

=countdates(A1:A10)

Mike

"Kim" wrote:

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?

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
Counting 7 and 8 occurances [email protected] Excel Discussion (Misc queries) 2 May 9th 07 02:59 AM
Counting occurances LauriS Excel Discussion (Misc queries) 8 March 29th 07 07:34 PM
Counting Occurances Rusty Excel Discussion (Misc queries) 5 July 10th 06 08:29 PM
counting occurances SR89 Excel Worksheet Functions 6 June 28th 06 01:46 AM
Counting Date Occurances JerryBS Excel Worksheet Functions 1 March 6th 05 07:29 PM


All times are GMT +1. The time now is 08:00 PM.

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"