E
Edward
As a result Excel 2003 shows 8 (week number) for 15.2.2005, but the correct
result is 7.
For Year 2004 the answer is correct.
result is 7.
For Year 2004 the answer is correct.
As a result Excel 2003 shows 8 (week number) for 15.2.2005, but the correct
result is 7.
For Year 2004 the answer is correct.
For the OP: See also the function on my site that don't need the UDF
The problem is if you use the UDF that if you send the workbook to someone else
you must add the UDF to the workbook.
Hi Ron
1) What if people send only one sheet.
2) what if they want to use it in a other workbook
Most people don't know how to copy a UDF in a module
3)what if they copy it in there personal.xls(like you)
With the Add-in we try to make it easy to insert the formulas in a sheet
We have no problems then we hope<g>
Also we not use the weeknum functions but others because as you know it
will not translate the weeknum function to a other language.
Also the Text function you can't use international
Y for year is in Dutch j for example
Ron Rosenfeld said:Actually, if you read the documentation in HELP, you will see that the Excel
WEEKNUM function does NOT give the ISO week number, which is probably what you
are expecting. So to talk about "correct" you must first define what your
standards are. WEEKNUM in Excel does give the "correct" answer -- at least it
complies with it's own definition which is NOT the SAME definition as the ISO
standard.
If you want to obtain an ISO compliant week number, I think the easiest way is
to use either a VBA User Defined Function or, if you have Longre's morefunc.xll
add-in, you can use his ISO.WEEKNUM function.
Below is a VBA routine. 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 below into the window that opens.
You can then use =isoweeknum(date) in your workbook.
================================
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
The script works perfect, Thanks
Edward
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.