+ Reply to Thread
Results 1 to 8 of 8

WEEKNUM Returning wrong #?

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Jacksonville
    MS-Off Ver
    Excel 2010
    Posts
    74

    WEEKNUM Returning wrong #?

    I would assume that the first week of the year is Jan. 1st but the formula returns #2 starting at Jan 4th. Why is that?
    Attached Files Attached Files

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: WEEKNUM Returning wrong #?

    Unfortunately, week numbers aren't quite as simple and straightforward as we'd like. Have a read of this wiki article on the subject:

    Week Numbers

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: WEEKNUM Returning wrong #?

    Quote Originally Posted by MnMCarta View Post
    I would assume that the first week of the year is Jan. 1st but the formula returns #2 starting at Jan 4th. Why is that?
    Always good to read Excel help pages first. (Although they often contain some factual errors. :-( ) Click on https://support.office.com/en-us/art...rs=en-US&ad=US.

    Specifically:
    There are two systems used for this function:

    System 1[:] The week containing January 1 is the first week of the year, and is numbered week 1.

    System 2[:] The week containing the first Thursday of the year is the first week of the year, and is numbered as week 1. This system is the methodology specified in ISO 8601, which is commonly known as the European week numbering system.
    Also see an explanation of the optional second parameter ("return type").
    Last edited by joeu2004; 02-23-2015 at 01:50 PM. Reason: cosmetic

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,655

    Re: WEEKNUM Returning wrong #?

    Try this in E2:

    =INT((A2-DATE(YEAR(A2),1,1))/7)+1
    Quang PT

  5. #5
    Registered User
    Join Date
    11-01-2012
    Location
    Jacksonville
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: WEEKNUM Returning wrong #?

    Thank you everyone I came back here cause I found something online that I thought finally I could contribute to helping. lol but I see Bebo021999 gave me a formula. I will try it. I found this though

    =TRUNC(((AU2-DATE(YEAR(AU2),1,0))+6)/7)

    and it seems to work but might be because the first fell on a sunday. lol Well, at least I have a year until it might not work

  6. #6
    Registered User
    Join Date
    11-01-2012
    Location
    Jacksonville
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: WEEKNUM Returning wrong #?

    Quote Originally Posted by joeu2004 View Post
    Always good to read Excel help pages first. (Although they often contain some factual errors. :-( ) Click on https://support.office.com/en-us/art...rs=en-US&ad=US.

    Specifically:


    Also see an explanation of the optional second parameter ("return type").
    I read that and I saw that having to put the year in there was something I would have to remember down the road when a new year came. Was trying to eliminate that need

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719

    Re: WEEKNUM Returning wrong #?

    Quote Originally Posted by MnMCarta View Post
    I found this though

    =TRUNC(((AU2-DATE(YEAR(AU2),1,0))+6)/7)

    and it seems to work but might be because the first fell on a sunday. lol Well, at least I have a year until it might not work
    You haven't really said what you want the formula to do?

    That formula makes the first 7 days of the year week 1, the next 7 week 2 etc. At the end of the year the last day (or two days in a leap year) will be in week 53. It takes no account of days of the week. Is that what you need? If not then please explain
    Audere est facere

  8. #8
    Registered User
    Join Date
    11-01-2012
    Location
    Jacksonville
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: WEEKNUM Returning wrong #?

    Yea it works for what i need.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Date formatting weeknum coming out wrong
    By Tradesman in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-30-2012, 07:37 AM
  2. Excel 2007 : IF function returning wrong value
    By bdinsdale in forum Excel General
    Replies: 3
    Last Post: 06-27-2011, 03:00 PM
  3. Excel 2007, weeknum() returning incorrect number
    By jakobahman in forum Excel General
    Replies: 3
    Last Post: 08-13-2009, 03:14 AM
  4. If Then returning wrong value
    By hawaiimovieguy in forum Excel General
    Replies: 3
    Last Post: 01-09-2007, 05:08 AM
  5. weeknum wrong?
    By Arien in forum Excel General
    Replies: 0
    Last Post: 01-17-2005, 11:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1