Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Number of Specific Day within Dates
Hi Abdul,
You can use the below function to count the days. First though, you will need to copy the code at the end of this post into a VBA module. A1 B1 C1 D1 1 Jun 2009 30 Jun 2009 Thursday =countday(A1,B1,C1) Public Function CountDay(StartDate As Date, EndDate As Date, DayName As String) As Long Dim iDate As Date, dCount As Long iDate = StartDate dCount = 0 Do Until iDate EndDate If Not iDate EndDate Then If Format(iDate, "dddd") = DayName Then dCount = dCount + 1 End If End If iDate = iDate + 1 Loop CountDay = dCount End Function -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...tions/200906/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - count the number of records between two specific dates. | Excel Worksheet Functions | |||
Linking a Specific Word to a Specific Number | Excel Worksheet Functions | |||
Linking a Specific Word to a Specific Number | Excel Worksheet Functions | |||
Linking a Specific Word to a Specific Number | Excel Worksheet Functions | |||
Determining the number of specific days between two dates in Excel | Excel Worksheet Functions |