+ Reply to Thread
Results 1 to 4 of 4

Get the date of saturday in a week from a week number / year

  1. #1
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Get the date of saturday in a week from a week number / year

    Hi guys,

    i get a weeknumber and a year number as input from a user.
    I'd like to get the date of the Saturday in that week.

    For example, week 11/2015 (last week), the date of the saturday would be 3/14
    How do I go about that in vba?
    Let's say I have variables
    wk = 11
    and
    yr = 2015

    How do I translate that to 03/14/2015 ?

    Thanks,

    Jasper

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Get the date of saturday in a week from a week number / year

    Hi,

    Do you really need VBA for this.

    With 2015 in A1 and 11 in A2 then

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you need to use it in VBA then just read the formula cell into VBA
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Get the date of saturday in a week from a week number / year

    Does this help?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Note: uses A2 as helper cell.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Get the date of saturday in a week from a week number / year

    Quote Originally Posted by Richard Buttrey View Post
    =DATE(A1,1,1)+7*A2-WEEKDAY(DATE(A1,1,1)+7*A2)
    This finds the 11th Saturday in 2015 for the example given but this depends on how your week numbers work - in the Netherlands I imagine these might be ISO week numbers, in which case the first Saturday of the year might be in the last week of the previous year, e.g. ISO week number 1 for 2016 begins on 4th January 2016. The previous Saturday (2nd Jan) is in week 53 of 2015

    Given the above this formula should give you the correct Saturday date (assuming ISO week numbers) in any year

    =DATE(A1,1,3+A2*7)-WEEKDAY(DATE(A1,1,3))
    Audere est facere

+ 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] Calculate US Government Fiscal Year Week with Sunday(Start) and Saturday (End)
    By CHRISTINA1234 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-23-2013, 06:13 AM
  2. Replies: 7
    Last Post: 05-02-2013, 06:48 AM
  3. Week Name = "Week" and the date of Saturday for that week.
    By Hudas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2012, 10:53 PM
  4. Year and week, adding zero before week number
    By randalino in forum Excel General
    Replies: 1
    Last Post: 06-23-2009, 10:34 AM
  5. Replies: 1
    Last Post: 08-23-2005, 11:42 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