Microsofts week numbering

  • Thread starter Thread starter Mark C
  • Start date Start date
M

Mark C

Can anyone tell me why Microsofts =weeknum() function does not agree with my
calendar. Excel tells me 22/06/05 is week 26, my Calendar and Diary tell me
it is week 25.

Is there a fix for this or how should I handle it?

TIA Mark
 
Can anyone tell me why Microsofts =weeknum() function does not agree with my
calendar. Excel tells me 22/06/05 is week 26, my Calendar and Diary tell me
it is week 25.

Is there a fix for this or how should I handle it?

TIA Mark

Your calendar and Microsoft are using different week numbering conventions.

See HELP for the convention used by the Microsoft function.

Your calendar may be using the ISO weeknumbering function. If that is the
case, you may use this UDF: =ISOWEEKNUM(date)

To use the UDF you must enter it into a VBA module.

<alt><F11> opens the VB editor.
Insert/Module and paste the code below into the window that opens.


======================
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Weeknum formula 2
Inverse to WEEKNUM 8
week number 4
DateDif ? 3
Count based on multiple criteria 2
Weeknum help 2
Weeknum Within a Range 5
Wrong Week number 14

Back
Top