Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Abnormal results with Excel Weeknum ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
u473@aol.com - 06 Jul 2006 13:15 GMT
I have been using Weeknum for some time.
The second parameter is to define whether the week starts on Monday(2)
or Sunday(1)

The first of the year 2006 was a Sunday.
Entering =weeknum(1/7/2006,2) which is a Saturday in cell A2 produced
1.  And I agree.

Entering 1/7/2006 in cell A1 and weeknum(A1,2) in cell A2 produced 2
???.

Entering 12/25/2006 which is a Monday, in cell A1 and weeknum(A1,2) in
cell A2 produced 53 ???.

Entering =weeknum(12/25/2006,2)  in cell A2 produced 1.  That is weird.
You would expect 52.

Am I going to be obliged to use an If... to  produce the expected
result ?
Can you give me some light ?

Thank you,

Wayne
Bob Phillips - 06 Jul 2006 13:22 GMT
Depends what you mean by expected results. Those are the expected results
for the Excel Weeknum function.

Read up at http://www.rondebruin.nl/weeknumber.htm

Signature

HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

> I have been using Weeknum for some time.
> The second parameter is to define whether the week starts on Monday(2)
[quoted text clipped - 20 lines]
>
> Wayne
Ron Rosenfeld - 06 Jul 2006 14:03 GMT
>I have been using Weeknum for some time.
>The second parameter is to define whether the week starts on Monday(2)
[quoted text clipped - 20 lines]
>
>Wayne

The WEEKNUM function is returning results as it is documented to do so.

The "light" if you will is how you are implementing the formula.

Within a function, the value:  1/7/2006  does not get translated to a date.
Rather it is translated as 1 divided by 7 divided by 2006 -- some very small
number equivalent to Saturday January 0, 1900

When you enter 1/7/2006 into a cell, then Excel translates it to the date
Saturday, January 07, 2006

This is why you get different answers to your two functions.

=weeknum(1/7/2006,2) is equivalent to

=WEEKNUM(DATE(1900,1,0),2)

and

=weeknum(a1,2)

is equivalent to

=WEEKNUM(DATE(2006,1,7),2)

--ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.