+ Reply to Thread
Results 1 to 4 of 4

How to calculate the full WC date from YY-WW?

  1. #1
    Registered User
    Join Date
    10-07-2008
    Location
    London
    Posts
    39

    How to calculate the full WC date from YY-WW?

    I have weeks in format YY-WW (this week is 09-18) and wish to calculate the full date for the week commencing day for that week.

    '09-18 is in cell S8. To work out the date I currently have:

    =DATE(LEFT(S8,2),1,RIGHT(S8,2)*7-8)-WEEKDAY(DATE(LEFT(S8,2),1,3))

    Which I thought was working fine, but turns out to be the WC date for 1909. I'll probably have to change the -8, that's not a problem, but I can't work out how to get it to 2009.
    Last edited by shockeroo; 04-30-2009 at 02:57 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to calculate the full WC date from YY-WW?

    Doesn't this do what you want:

    =DATE("20"&LEFT(S8,2),1,RIGHT(S8,2)*7-8)-WEEKDAY(DATE(LEFT(S8,2),1,3))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-07-2008
    Location
    London
    Posts
    39

    Re: How to calculate the full WC date from YY-WW?

    Oh-so simple... thank you!

  4. #4
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: How to calculate the full WC date from YY-WW?

    you need to add 2000 to your year, date function expects full years!

    Please Login or Register  to view this content.
    Will return the correct date based on january 3rd, change the 3 to day you want!

    more robust as it will work for any year

    Please Login or Register  to view this content.
    This will return the correct date based on the first weekday in january, so replace Both DayOfWeek with :-

    0-Sat,1-Sun....6-Fri

    if you want the last weekday in december subtract 7!
    Last edited by squiggler47; 04-30-2009 at 03:12 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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