How can I convert a date format to an ISO week format (in EXCEL)?
|
Hi ELI See http://www.rondebruin.nl/isodate.htm -- Regards Ron de Bruin http://www.rondebruin.nl "ELI" wrote in message ... |
On Wed, 6 Jul 2005 08:34:03 -0700, ELI wrote:
You can use this UDF: =============== 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 ================= To enter it, <alt-F11 opens the VB Editor. Ensure your project is highlighted in the Project Explorer window, then Insert/Module and paste the code into the window that opens. To use it: =ISOWeeknum(date) will give the ISO compliant weeknumber for any date. 'date' may be a cell reference. --ron |
All times are GMT +1. The time now is 03:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com