News, tips, advice, support for Windows, Office, PCs & more
Home icon Home icon Home icon Email icon RSS icon

We're community supported and proud of it!

  • What years is June 12 on a Saturday?

    Home Forums AskWoody support Productivity software by function MS Excel and spreadsheet help What years is June 12 on a Saturday?

    • This topic has 17 replies, 7 voices, and was last updated 4 weeks ago.
    Viewing 13 reply threads
    • Author
      Posts
      • #2373280
        Ron M
        AskWoody Plus

        I figure that this can be done in Excel, but my knowledge of the “beyond basics” is not as good as I wish it was.

        I want to know how to find out which years since 1965 had a June 12th on a Saturday?  Any insight that anyone can offer will be greatly appreciated.  Thanks.

        Ron M

      • #2373291
        anonymous
        Guest

        Think the ryhme “30 days hath September, April, June and November. All the rest have 31, except February alone which has 28 days clear and 29 in each leap year.”
        Pick a January 1st in the past (in 20th century) and find its day of the week and start counting. Modulo arithmatic comes in handy for determining what day of the week.
        I used this caculation in 1992 with Supercalc!
        Have you tried a search engine like G**gle?
        Hope this helps

      • #2373293
        anonymous
        Guest
        1 user thanked author for this post.
      • #2373298
        Alex5723
        AskWoody Plus
        1 user thanked author for this post.
      • #2373319
        PaulK
        AskWoody Lounger

        This is the inside back cover of the 1978 Yellow Pages telephone book, Los Angeles, CA.
        Complete, then top and bottom for clarity. Top is 365-day years, bottom is leap years.
        Click on an image to magnify.

        Cal0-1
        Cal1-1
        Cal2-1

        • #2373971
          PaulK
          AskWoody Lounger

          Cal

          “which years since 1965 had a June 12th on a Saturday?”
          Look for all years for calendars 6 (365-day year) and 12 (leap year).

      • #2373413
        OscarCP
        AskWoody Plus

        Maybe this can help?

        https://www.timeanddate.com/calendar/repeating.html?year=2021

        Go there and scroll to near the bottom, where there is a calculator and click on the “Date on Weekday” tab, then enter the date (12) and day of the week (Saturday) and hit the green button “Tell me”, then lean back …

        Windows 7 Professional, SP1, x64 Group W (ex B) & macOS Mojave + Linux (Mint)

      • #2373608
        Ron M
        AskWoody Plus

        WOW, what a range of replies.  My thanks to all who did so.

        To my anonymous friend(s), the one with the calendar years the same as 2021 looks like it will do the trick.

        Alex5723, I am afraid I am not clear as to how to interpret your answer.

        PaulK, unless I am missing something, your tables only go to the Year 2000.  They work to that day and present an interesting approach.

        OscarCP, you reference is similar to that of one of the anonymous contributors and is suitable for my purposes – two great minds are thinking alike.

        I was actually hoping that there might be some simple(?) VBA code that would solve the problem.  Just to show y’all how old I am, I could probably write an algorithm in Fortran.  My “problem” would be to translate it into Excel VBA as my knowledge of VBA is limited right now and Fortran has no implicit Date/Time variables.  However, a couple of the supplied solutions will work perfectly for my purpose.

        Ron

      • #2373653
        Paul T
        AskWoody MVP

        your tables only go to the Year 2000

        The calendar repeats every 7 years so you can work it out.

        cheers, Paul

        • #2373670
          RDRguy
          AskWoody Lounger

          Sorry but, NO … it doesn’t 😕

          But this calculator at this website does it up to year 2100 👍

          And … the calculator at this website allows you to set the length of the desired search year period for your query.

          Example: to find all years with June 12th occurring on Saturday between 1800 thru 2800 …

          1) set: “Date to find day of week for:” to Jun 12 1800
          2) set: “Optional number of years: #” to 1000
          3) click: “Find Day of the Week”

          Scroll all the way down near the bottom of the page and you’ll find 140 years listed between 1800 and 2800 with June 12th occurring on Saturday.

          Enjoy 👍 👍 👍

          Win7 - PRO & Ultimate, x64 & x86
          Win8.1 - PRO, x64 & x86
          Groups A, B & ABS

          1 user thanked author for this post.
      • #2373683
        Alex5723
        AskWoody Plus

        Alex5723, I am afraid I am not clear as to how to interpret your answer

        June 5, 12, 19, 26 all fall in the listed years under Saturday column.

      • #2373751
        anonymous
        Guest

        RDRGuy, thanks for the web sites.  They work for me.  Who knew there were so many sites that tackled this problem?

        Ron M

      • #2373803
        anonymous
        Guest

        Please remember, it is not just common years (dominical C) that begin and end on a Friday; but also leap years (dominical DC) that begin on a Thursday then end on a Friday that interest you. As 12 June falls after a possible 29 February, both need to be included.
        https://en.wikipedia.org/wiki/Dominical_letter#Dominical_letters_of_the_years

        Online calculators would already account for this. If you are designing your own calculation, I recommend the additional reading.

        1 user thanked author for this post.
      • #2373833
        RetiredGeek
        AskWoody MVP

        Here’s some VBA to do the deed.

        Option Explicit
        
        Sub FindDayofYear()
        
          Dim iStartYear As Integer
          Dim iMonth     As Integer
          Dim iDay       As Integer
          Dim iYearCnt   As Integer
          Dim iDayOfWeek As Integer
          Dim iCntr      As Integer
          Dim dteDate    As Date
          Dim iNextYr    As Integer
          
          iStartYear = Range("StartYear")
          iMonth = Range("Month")
          iDay = Range("Day")
          iYearCnt = Range("NoYears")
          iDayOfWeek = Range("DayOfWeek")
          iNextYr = 2
          
          For iCntr = iStartYear To iStartYear + iYearCnt
          
            dteDate = DateSerial(iCntr, iMonth, iDay)
        
            '*** Change 7 (saturday) to any other number to find diff day.
            If (Weekday(dteDate) = iDayOfWeek) Then
              Cells(iNextYr, "E") = iCntr
              iNextYr = iNextYr + 1
            End If
            
          Next iCntr
        
        End Sub 'FindDayofYear
        
        DayOfYear
        

        HTH 😎

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

        1 user thanked author for this post.
        • #2373842
          RDRguy
          AskWoody Lounger

          I like it 👍 … & now I don’t have to roll my own to keep in my tool box

          Win7 - PRO & Ultimate, x64 & x86
          Win8.1 - PRO, x64 & x86
          Groups A, B & ABS

      • #2373836
        OscarCP
        AskWoody Plus

        Since Ron M likes Fortran, perhaps 77, here is a little program in Fortran 77 I just wrote that finds the years when the same day of the same month fall in the same day of the week:

        I am attaching a text file with the code, to avoid having hidden characters. I think that reading it makes clear what is involved, as Fortran is very straightforward with formulas and the code of the only subroutine needed is included. I am using their default types for the variables, to simplify matters.

        repit

         

        Windows 7 Professional, SP1, x64 Group W (ex B) & macOS Mojave + Linux (Mint)

        1 user thanked author for this post.
        • #2373846
          OscarCP
          AskWoody Plus

          Hmm … I forgot that Fotran 77 fixed format requires statements to start in column 7 and end in column 71 at most.

          so the statement in the subroutine has to be changed as follows to comply with more demanding compilers than the one I used in this case:

          JDAY = iDAY-32075+1461*(iYEAR+4800+(MONTH-14)/12)/4+367*
          .(MONTH-2-(MONTH-14)/12*12)/12-3*((iYEAR+4900+(MONTH-14)/12)/100)
          ./4

          All  statements begin in column 7 at a minimum, and the continuation lines have the “.” in column 6.

          And in the name of the file “.txt” has to be changed to “.f “, of course.

          Windows 7 Professional, SP1, x64 Group W (ex B) & macOS Mojave + Linux (Mint)

      • #2373892
        Ron M
        AskWoody Plus

        RG, thanks for the VBA code. 😁  It will take me a few days, but I will give it a go as soon as I figure out how to put it together with an Excel spreadsheet.  I have a series of Lessons on VBA coming up soon,  so this will be a good sub to practice with.

        Ron M  🤠

    Viewing 13 reply threads

    Please follow the -Lounge Rules- no personal attacks, no swearing, no politics or religion.

    Reply To: What years is June 12 on a Saturday?

    You can use BBCodes to format your content.
    Your account can't use Advanced BBCodes, they will be stripped before saving.