+ Reply to Thread
Results 1 to 4 of 4

Formula For Sundays In Annual Calender

  1. #1
    Registered User
    Join Date
    12-20-2004
    Posts
    88

    Formula For Sundays In Annual Calender

    I'd like to arrange a formula where I can enter the year (example: 2007) in cell A1 and I could get the date for each sunday (mm/dd/yyyy) of the year and have them entered in locations B1 through B52.

    Any help is appreciated.
    Travelersway

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    You would have to test the 365 days with weekday(eachdate)=1 ...

    HTH
    Carim

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Enter in A1 a the date 01/01/07 and custom format as YYYY

    then in B1 enter

    =A1+(WEEKDAY(A1)>=1)*7-WEEKDAY(A1)+1

    Then in B2 enter

    =B1+7

    Custom Format Col B as mm/dd/yyyy

    PS Change the 1 to 2 for first Monday etc

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If you have the 1st jan date in A1 then you only need this formula in B1

    =A1+7-WEEKDAY(A1-1)

    or with just the year in A1

    =DATE(A1,1,8-WEEKDAY(DATE(A1,1,0)))

+ 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