Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default 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
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
Excel - count the number of records between two specific dates. DK Excel Worksheet Functions 4 May 21st 08 03:08 PM
Linking a Specific Word to a Specific Number [email protected] Excel Worksheet Functions 1 July 11th 06 05:55 PM
Linking a Specific Word to a Specific Number [email protected] Excel Worksheet Functions 2 July 11th 06 05:50 PM
Linking a Specific Word to a Specific Number [email protected] Excel Worksheet Functions 1 July 11th 06 04:29 PM
Determining the number of specific days between two dates in Excel jon s Excel Worksheet Functions 9 March 21st 05 09:13 PM


All times are GMT +1. The time now is 09:39 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"