+ Reply to Thread
Results 1 to 10 of 10

Year and Week number but I need to convert to the date of that weeks start

  1. #1
    Registered User
    Join Date
    05-03-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    56

    Year and Week number but I need to convert to the date of that weeks start

    Hello

    I REALLY hope someone can help me. When I download my data I get Cell A containing 201722 where 2017 is the year and 22 is the week of that year. I need to insert column B and make it show the Mondays date of that week ie Im expecting outcome to be 29/5/17

    How do I do this?

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,907

    Re: Year and Week number but I need to convert to the date of that weeks start

    Try:

    =DATE(LEFT(A1,4),1,1)+RIGHT(A1,LEN(A1)-4)*7-7

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

    Re: Year and Week number but I need to convert to the date of that weeks start

    Not sure how you define fist week of the year, but try:

    Please Login or Register  to view this content.
    In which:
    DATE(LEFT(A1,4),1,1) is firs date of the year
    +CHOOSE(WEEKDAY(DATE(LEFT(A1,4),1,1)),1,0,6,5,4,3,2) is moving to first Monday of the year
    +(RIGHT(A1,2)-1)*7 moving to Monday of next (22-1=21) week
    Quang PT

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Year and Week number but I need to convert to the date of that weeks start

    Try

    =DATE(2017,1,1)+(RIGHT(A1,2)-1)*7-WEEKDAY(DATE(2017,1,1)+(RIGHT(A1,2)-1)*7)+2

    You could put "start date" of 01/10/2017 in a cell e.g X1..

    =X1+(RIGHT(A1,2)-1)*7-WEEKDAY(X1+(RIGHT(A1,2)-1)*7)+2

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,907

    Re: Year and Week number but I need to convert to the date of that weeks start

    Edit:

    =WORKDAY.INTL(DATE(LEFT(A1,4),1,0),RIGHT(A1,LEN(A1)-4),"0111111")

  6. #6
    Registered User
    Join Date
    05-03-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    56

    Re: Year and Week number but I need to convert to the date of that weeks start

    Ok this works, although its putting in the Sundays date and I would like the Mondays date so I altered to
    =DATE(LEFT(A1,4),1,1)+RIGHT(A1,LEN(A1)-4)*7-6 and seems to work, thanks

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

    Re: Year and Week number but I need to convert to the date of that weeks start

    Quote Originally Posted by darrenj1471 View Post
    Ok this works, although its putting in the Sundays date and I would like the Mondays date so I altered to
    =DATE(LEFT(A1,4),1,1)+RIGHT(A1,LEN(A1)-4)*7-6 and seems to work, thanks
    It is confusing me. Have you tried with other year, i.e 2016?

  8. #8
    Registered User
    Join Date
    05-03-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    56

    Re: Year and Week number but I need to convert to the date of that weeks start

    The other options Im struggling with at present so can someone advise if there is an issue with the first reply?:

    =DATE(LEFT(A1,4),1,1)+RIGHT(A1,LEN(A1)-4)*7-6

  9. #9
    Registered User
    Join Date
    05-03-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    56

    Re: Year and Week number but I need to convert to the date of that weeks start

    Actually doesn't seem to work if 2016, or 2018 as its just putting same date in with different year ie not working correctly

  10. #10
    Registered User
    Join Date
    05-03-2013
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    56

    Re: Year and Week number but I need to convert to the date of that weeks start

    =DATE(LEFT(A3,4),1,1)+CHOOSE(WEEKDAY(DATE(LEFT(A3,4),1,1)),1,0,6,5,4,3,2)+(RIGHT(A3,2)-1)*7

    This one seems to work for all years so seems to do the trick. You guys are awesome cheers

+ 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. [SOLVED] Add 12 weeks to date to return week number turn over at 52 weeks
    By nigelog in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2017, 05:58 AM
  2. [SOLVED] Macro that displays all the weeks between Start Week and End Week (ends in next year)
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-31-2014, 05:38 AM
  3. Calculate Start & End Date & Month for Each Week In Fiscal Year
    By sarndt01 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2014, 02:14 PM
  4. week number based on year start 01/10
    By tony0710 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-02-2014, 12:21 PM
  5. [SOLVED] Determine Week Start Date From Year And Number
    By SalientAnimal in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-23-2013, 07:51 AM
  6. Convert date to week number for fiscal year starting July 25
    By ARayburn in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-15-2013, 10:07 AM
  7. formula/macro. How to convert data (weekday, week number, year) to a date?
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2011, 10:34 PM

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