LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Week Number using VBA in Excel


"Ron de Bruin" wrote in message ...
Thank for your reply Hans

I an updating all my webpages on the moment.
When I do the Week number and ISO page I will check all the stuff on it and maybe do a small update

Have a nice day
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


You too, Ron.

I would be pleased if you included my WkIso() function,
but you might decide that it looks too cryptic.
It had to work with integers, to avoid small binary inaccuracies like
1.2-1.1-0.1 < 0, and that made for big unrecognizeable numbers.
I suspect that the Datepart bug comes from a related problem.

Greetings, Hans.




"Hans Terkelsen" <dk wrote in message ...

"Ron de Bruin" wrote in message ...
Hi Hans

I not test your function but do you get the same results as the VBA function and the formulas on my page
http://www.rondebruin.nl/weeknumber.htm#information

See the Calendar workbook




Hi Ron d B!

I have been slow to answer, sorry.

Yes, I get the same results as your function and formula gives.
The only difference is a few days at the start of the dates.
We can consider Daniel Mahers function as a reference.

My checker runs through all the dates, and compares the putative(?) ISO weeknumber function to a running week counter that

follows
the appropriate rules.
Takes only a few minutes in VB.

DM's function is true 4/1/100-31/12/9999 according to that checker.
The first 3 days it errors, if anybody should care.
Ptolemy maybe:-)

Your worksheet function likewise, 2/1/1900-31/12/9999, agrees with the others.

Did you want a second opinion on the Calendar workbook?
Useful and correct :-)
A reverse weeknumber function, from ISOweekyear and weeknumber to a date, agrees with your date for first monday 1901 to 9999,

but
not for 1900 as you know. Yours is the correct date.
Another way to sidestep the 29/2/1900 issue, is to add 400 years to the year in formulas.
All dates, weekdays, weeknumbers repeat after 400 years, and 29/2/2300 does not exist in Excel.
Then the calendar could go back to 1500!

I think I'll keep it as it is, Thankyou Ron, Greetings Hans.






 
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
group sales by week and week number Wanna Learn Excel Discussion (Misc queries) 7 November 7th 06 11:44 AM
Can Excel turn % hrs worked/week put in a cell into a real number BaffledFloridaExcelUser Excel Worksheet Functions 1 August 2nd 05 11:21 PM
How do I set up a week by week skill training schedule in excel? davidwatts Excel Discussion (Misc queries) 0 June 16th 05 11:32 PM
how to get week number in month in excel ? ikin Charts and Charting in Excel 2 January 16th 05 05:54 PM
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


All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"