LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Week numbers from an entered date

On Jun 18, 2:43*pm, "Vacuum Sealed" wrote:
Hi John

Reading from Chips site, I think this is what you're looking for...

ISO Week Number

Public Function IsoWeekNumber(InDate As Date) As Long
* * IsoWeekNumber = DatePart("ww", InDate, vbMonday, vbFirstFourDays)
End Function
Read carefully through the explaination and it will become clear...This
method uses the International Standards Organization (ISO) definition of a
week number.An ISO week always begins on a Monday, and ISO week 1 begins on
the Monday of the first week of the year that contains a Thursday.Said
differently, ISO week 1 is the first week (beginning on Monday) that has at
least four days.Note that it is possible that the first few days of a year
may fall into week 52 or week 53.Although this may seem quite counter
intuitive, it follows from the requirements first that all ISO weeks begin
on Monday,and second, that the first week must contain a Thursday.For
example, the year 2010 begins on Friday, 1-Jan-2010. Since this is later
than a Thursday (which is 7-Jan-2010),the week doesn't contains Thursday
(or, said another way,the week doesn't have at least four days), the ISO
week 1 begins on Monday, 4-January-2010.The day before the start of the
year, 31-December-2009, falls in ISO week 53 of the preceeding year,
2009.Rather than deal with the ambiguity of having a day that is in both
week 53 and week 0, the 53 carries through until 4-Jan-2010,which as noted
before is the Monday of the first week that contains a Thursday (or,
equivalently, the first week with four or more days).HTHMick....


Thanks - I will also give that a try out.

Johnnboy
 
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
Convert regular Date to Week Ending or Week Beginning Dates Sam H Excel Discussion (Misc queries) 5 April 3rd 23 04:39 PM
how do i stop excel from converting numbers entered into a date newuser Excel Discussion (Misc queries) 2 May 6th 10 11:42 PM
generate serial numbers and date it entered irealtymods Excel Discussion (Misc queries) 3 August 5th 09 08:16 AM
How do I get a cell to show the day of the week when date entered Captain Excel Discussion (Misc queries) 9 December 27th 05 06:45 AM
Transpose week numbers to date Lewej Excel Discussion (Misc queries) 2 May 6th 05 12:34 PM


All times are GMT +1. The time now is 09:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"