+ Reply to Thread
Results 1 to 5 of 5

How to find yearly dates for weekdays

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    How to find yearly dates for weekdays

    Hello
    Quote Originally Posted by bebo021999 View Post
    In A3:
    =DATE(A1,1,1)+CHOOSE(WEEKDAY(DATE(A1,1,1)),0,6,5,4,3,2,1)
    A4 then copy down:
    =A3+7

    Format as you like in format cell/custom
    This formula finds all the Sundays with dates for a year. How to find other days i.e Fridays for the year?


    Best Regards
    Imran Bhatti
    Teach me Excel VBA

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

    Re: How to find yearly dates for weekdays

    Try for Friday:

    =DATE(A2,1,1)+CHOOSE(WEEKDAY(DATE(A2,1,1)),5,4,3,2,1,0,6)

    Rule for the list of CHOOSE function:
    Sunday: starts with 0
    Monday: starts with 1
    ...
    Fri: starts with 5
    Quang PT

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: How to find yearly dates for weekdays

    So the logic is in the CHOOSE section

    which ever day we want we should start the set from that day serial?

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

    Re: How to find yearly dates for weekdays

    Quote Originally Posted by ImranBhatti View Post
    So the logic is in the CHOOSE section

    which ever day we want we should start the set from that day serial?
    the list is :
    0,6,5,4,3,2,1 for Sun

    For the next day, the last one to be the first one

    1,0,6,5,4,3,2 for Mon

    2,1,0,6,5,4,3 for Tue

    ...

    5,4,3,2,1,0,6 for Fri...

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: How to find yearly dates for weekdays

    Nice magic of digits.

    Thanks a lot.

+ 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] Group dates by weekdays
    By etaver87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2016, 10:59 AM
  2. Fill dates with weekdays/workdays only
    By DJ Bjorklund in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2013, 12:05 PM
  3. [SOLVED] Dates wont format to weekdays
    By georgeparker88 in forum Excel General
    Replies: 3
    Last Post: 08-06-2012, 09:10 AM
  4. Returning Nonsequential dates from weekdays?
    By Warbler in forum Excel General
    Replies: 5
    Last Post: 01-11-2012, 06:37 PM
  5. Dates without weekdays
    By smurray7 in forum Excel General
    Replies: 8
    Last Post: 08-24-2011, 04:26 AM
  6. Number of weekdays between 2 dates
    By certain_death in forum Excel General
    Replies: 3
    Last Post: 08-05-2008, 04:28 AM
  7. [SOLVED] How do i count number of weekdays between two dates?
    By Sanjay Shah in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-04-2005, 12:06 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