ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I convert a date format to an ISO week format (in EXCEL)? (https://www.excelbanter.com/excel-discussion-misc-queries/34023-how-can-i-convert-date-format-iso-week-format-excel.html)

ELI

How can I convert a date format to an ISO week format (in EXCEL)?
 


Ron de Bruin


Hi ELI

See
http://www.rondebruin.nl/isodate.htm



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


"ELI" wrote in message ...




Ron Rosenfeld

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