Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Counting 7 and 8 occurances | Excel Discussion (Misc queries) | |||
Counting occurances | Excel Discussion (Misc queries) | |||
Counting Occurances | Excel Discussion (Misc queries) | |||
counting occurances | Excel Worksheet Functions | |||
Counting Date Occurances | Excel Worksheet Functions |