#1   Report Post  
gregork
 
Posts: n/a
Default Week Numbers

If I enter a week number in a cell I want to have a formula that returns
the end date for that date (based on ISO week
numbers)

GK


  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi gregork

This will depend on the Year
More info about week numbers you can find here
http://www.rondebruin.nl/weeknumber.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"gregork" wrote in message ...
If I enter a week number in a cell I want to have a formula that returns
the end date for that date (based on ISO week
numbers)

GK




  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Sat, 19 Feb 2005 23:15:07 +1300, "gregork" wrote:

If I enter a week number in a cell I want to have a formula that returns
the end date for that date (based on ISO week
numbers)

GK


You can do that with a UDF.

To enter this UDF, <alt-F11 opens the VB Editor.

Ensure your project is highlighted in the project explorer window, then
Insert/Module and paste the code below into the window that opens.

Use this by entering the formula =ISOWeeknum(dt) where dt is either a date or a
cell reference containing a date.

=================================
Function ISOWeeknum(dt As Date) As Integer
ISOWeeknum = DatePart("ww", dt, vbMonday, vbFirstFourDays)
If ISOWeeknum 52 Then
If DatePart("ww", dt + 7, vbMonday, vbFirstFourDays) = 2 Then
ISOWeeknum = 1
End If
End If
End Function
================================
--ron
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
Converting Numbers to Text properly Shirley Munro Excel Discussion (Misc queries) 1 February 16th 05 03:01 PM
How do I use week numbers for sub-totalling? Tinpot Excel Discussion (Misc queries) 2 February 4th 05 04:25 PM
Line or bar graphs for tracking stocks profit and loss. Mocity Charts and Charting in Excel 1 January 21st 05 01:21 AM
I need week number in excell from a date, first week must be mini. jPeich Excel Discussion (Misc queries) 4 January 5th 05 01:21 AM
first week of year - according to european standard soren Excel Worksheet Functions 3 November 2nd 04 07:21 PM


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