Calendar Guides

How to Find the Day of the Week for Any Date: Zeller, Doomsday and Spreadsheet Codes

Zeller's congruence names the weekday of any Gregorian date. Two worked examples, doomsday anchors and spreadsheet weekday codes, plus the 1582 and 1752 limits.

Dial of the Prague Astronomical Clock, used to illustrate how to find the day of the week for any date
File photo of the dial of the Prague Astronomical Clock. Finding a weekday needs only a calendar, a spreadsheet or the arithmetic below. Photo: Uoaei1 / Wikimedia Commons, cropped, edited · Source · CC BY-SA 4.0

2 free printables below ↓

In this article
  1. The quickest way to look up a weekday
  2. How a weekday moves from one year to the next
  3. How to calculate a weekday with Zeller’s congruence
  4. How the doomsday anchors give a weekday in your head
  5. Which spreadsheet formula returns the weekday?
  6. Why dates before 1582 and 1752 give two answers
  7. Print the worksheet

The National Institute of Standards and Technology (NIST) lists Zeller’s congruence as “an algorithm to find the day of the week for any date,” and applied below it gives Thursday for July 4, 1776 and Saturday for Jan. 1, 2000. The formula below is the Gregorian version. We checked it against JavaScript’s calendar and an independent day count for every date from 1583 to 2400, with no mismatch. This page also covers the doomsday anchors, the spreadsheet codes and the dates where the calendar changed.

The quickest way to look up a weekday

For a modern date, a calendar or a spreadsheet is faster than any formula. Our printable yearly calendar shows every weekday of a year on one page, and the other printable calendars cover single months.

The arithmetic methods below matter when you have no calendar, when you want to check a result, or when a date is far from the years your calendar shows. Both Gregorian methods assume the Gregorian calendar, which the U.S. Naval Observatory (USNO) says was “first introduced in 1582.”

How a weekday moves from one year to the next

A common year has 365 days, which is 52 weeks and 1 day, so a date lands one weekday later the next year. A leap year has 366 days, and the shift is two weekdays. The leap day sits in February, so a date from March to December moves two weekdays when the later year is a leap year, and a date in January or February moves two when the earlier year is.

Which years are leap years? The USNO rule is that years divisible by 4 are leap years, “with the exception of centurial years that are not evenly divisible by 400.” The USNO adds that 1700, 1800, 1900 and 2100 are not leap years, while 1600, 2000 and 2400 are. For the full rule see what a leap year is.

The table below was computed with the formulas on this page and checked against JavaScript dates.

YearLeap year?Jan. 1July 4Doomsday weekday
2024YesMondayThursdayThursday
2025NoWednesdayFridayFriday
2026NoThursdaySaturdaySaturday
2027NoFridaySundaySunday
2028YesSaturdayTuesdayTuesday
2029NoMondayWednesdayWednesday
2030NoTuesdayThursdayThursday

Read down the July 4 column: Thursday, Friday, Saturday, Sunday, then a jump of two to Tuesday in 2028. NASA states that the Gregorian calendar “exactly repeats after 400 years,” because its 146,097 days divide evenly by 7. Our story on how often the calendar repeats lists the years that share a layout.

How to calculate a weekday with Zeller’s congruence

NIST’s Dictionary of Algorithms and Data Structures describes Zeller’s congruence in one line and gives no formula on its page, so the formula here is stated as arithmetic that you can test. For a Gregorian date:

h = (q + floor(13(m + 1) / 5) + K + floor(K / 4) + floor(J / 4) + 5J) mod 7

SymbolMeaning
qDay of the month
mMonth, with March = 3 through December = 12, and January = 13 and February = 14 of the previous year
KLast two digits of the year (after the January and February shift)
JFirst two digits of the year (the century)
h0 Saturday, 1 Sunday, 2 Monday, 3 Tuesday, 4 Wednesday, 5 Thursday, 6 Friday

Watch the January and February shift. For Jan. 1, 2000, use m = 13 and the year 1999, so K = 99 and J = 19. “Floor” means drop the fraction, and “mod 7” means keep the remainder after dividing by 7.

Worked example: July 4, 1776

  1. q = 4, m = 7, year 1776, so K = 76 and J = 17.
  2. floor(13 x 8 / 5) = floor(20.8) = 20.
  3. floor(K / 4) = 19 and floor(J / 4) = 4, and 5J = 85.
  4. Add: 4 + 20 + 76 + 19 + 4 + 85 = 208.
  5. 208 = 7 x 29 + 5, so h = 5, a Thursday.

Britain and its colonies had already moved to the Gregorian calendar in 1752, according to Royal Museums Greenwich, so the Gregorian formula applies to this date.

Worked example: Jan. 1, 2000

  1. q = 1. January counts as month 13 of 1999, so m = 13, K = 99 and J = 19.
  2. floor(13 x 14 / 5) = floor(36.4) = 36.
  3. floor(K / 4) = 24 and floor(J / 4) = 4, and 5J = 95.
  4. Add: 1 + 36 + 99 + 24 + 4 + 95 = 259.
  5. 259 = 7 x 37 + 0, so h = 0, a Saturday.

Both results match JavaScript’s date calculation. If your answer is off, first check that a January or February date used the previous year and months 13 and 14.

How the doomsday anchors give a weekday in your head

The doomsday method trades the formula for a handful of dates that share one weekday in any given year. We verified each anchor below for every year from 1800 to 2199, and none failed. Once you know the weekday of those dates for the year, count from the nearest one to your date.

Anchor datesNotes
4/4, 6/6, 8/8, 10/10, 12/12Even months, day equals month
5/9, 9/5Swap day and month
7/11, 11/7Swap day and month
Jan. 3Common years
Jan. 4Leap years
Last day of FebruaryFeb. 28 in a common year, Feb. 29 in a leap year

To find the year’s doomsday weekday, start from the century anchor: Friday for the 1800s, Wednesday for the 1900s, Tuesday for the 2000s and Sunday for the 2100s. Take the last two digits of the year (call them yy), then add floor(yy / 12), the remainder of yy divided by 12, and floor of that remainder divided by 4. Count forward that many days from the anchor, modulo 7.

For 2026: Tuesday plus 2 plus 2 plus 0 is 4 days, and Tuesday plus 4 days is Saturday. So 7/11 is a Saturday, and July 4 is seven days earlier, also a Saturday. For Jan. 1, 2000: the year is a leap year, so Jan. 4 is the doomsday. With yy = 0 nothing is added to the Tuesday anchor, so Jan. 4 is a Tuesday and Jan. 1 is a Saturday, matching Zeller.

Which spreadsheet formula returns the weekday?

Both Excel and Google Sheets build a date with the date function (DATE), as DATE(year, month, day), and read its weekday with the weekday function (WEEKDAY). Add the choose function (CHOOSE), which picks an item from a list, and the formula spells out the day name:

=CHOOSE(WEEKDAY(DATE(2000,1,1)),"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

This returns Saturday. The number that WEEKDAY gives depends on the return type, which is the optional second argument.

Return typeNumbers returnedJan. 1, 2000 gives
1 or omitted1 (Sunday) through 7 (Saturday)7
21 (Monday) through 7 (Sunday)6
30 (Monday) through 6 (Sunday)5

Microsoft Support lists these three codes and also codes 11 to 17, which start the week on other days. Google Docs Editors Help describes type 1 as counting from Sunday with Sunday as 1, and type 3 as counting from Monday with Monday as 0. If a result looks one day off, check the return type first.

Why dates before 1582 and 1752 give two answers

The Gregorian calendar replaced the Julian calendar that Julius Caesar introduced in 45 BC, according to the USNO. NASA writes that ten days were deleted, so “1582 October 4 was followed by 1582 October 15.” The days of the week kept their order through the gap: Thursday, Oct. 4, 1582 was followed by Friday, Oct. 15, 1582 (our computation).

Not every country changed then. Royal Museums Greenwich says Britain and its colonies made the change in 1752, when 2 September was followed by 14 September, and 11 days were “lost.” The weekday of the same label depends on which calendar wrote it.

Date as writtenCalendarWeekdayGregorian formula gives
Oct. 4, 1582JulianThursdayMonday
Oct. 15, 1582GregorianFridayFriday
Sept. 2, 1752 (Britain and colonies)JulianWednesdaySaturday
Sept. 14, 1752 (Britain and colonies)GregorianThursdayThursday

For a Julian date, the same steps work with one change: replace floor(J / 4) + 5J with 5 - J. We verified this variant against an independent Julian day count for every date from 1000 to 1582. When a source gives a date before 1582, find out which country and calendar wrote it before you pick a formula; a tool that projects the Gregorian calendar backward gives a different weekday from one that uses the Julian calendar.

The worksheet puts the Zeller steps, the two checks, the doomsday anchors and the spreadsheet codes on one page, so you can calculate a weekday at a desk with nothing else open.

Free printable downloads

Every template is free, needs no sign-up and prints on US Letter paper. Choose PDF for printing or PNG for screens and documents.

Day of the Week Finder Worksheet 2026 printables

  • Worksheet listing the steps of Zeller's congruence, doomsday anchor dates and spreadsheet weekday codes

    Day of the Week Finder Worksheet 2026

    One-page worksheet with the Zeller's congruence steps, two worked checks, doomsday anchor dates and spreadsheet weekday codes for finding the day of the week.

    PDF · 1 page · US Letter

  • Worksheet listing the steps of Zeller's congruence, doomsday anchor dates and spreadsheet weekday codes, ink-saver version

    Day of the Week Finder Worksheet 2026 (ink saver)

    One-page worksheet with the Zeller's congruence steps, two worked checks, doomsday anchor dates and spreadsheet weekday codes for finding the day of the week. Ink-saver version.

    PDF · 1 page · US Letter

Frequently asked questions

How can I find what day a date was?

Enter the year, month and day in a spreadsheet with its weekday function, look at a printed calendar for that year, or run Zeller's congruence by hand. For a date before 1582, first decide which calendar the source used.

Can I calculate a weekday without a calendar?

Yes. Zeller's congruence needs six numbers and one remainder after division by 7. The doomsday method gets there with an anchor weekday for the year and the fixed dates 4/4, 6/6, 8/8, 10/10 and 12/12.

Does the same date fall on the same weekday every year?

No. A common year has 365 days, which is 52 weeks plus 1 day, so a date moves one weekday later; a leap year has 366 days and moves it two. The Gregorian pattern repeats exactly only after 400 years, per NASA.

Is Zeller's congruence accurate?

For Gregorian dates, yes. We ran the formula in this story against JavaScript's calendar and an independent day count for every date from 1583 to 2400 and found no mismatch. It is wrong for dates that were written in the Julian calendar.

Why do historical weekday results differ between websites?

Some tools project the Gregorian calendar backward before 1582, while others switch to the Julian calendar at 1582 or at a country's own change date. Britain and its colonies changed in 1752, so the same label can give two weekdays.

Sources

  1. Zeller's congruence (National Institute of Standards and Technology (NIST), Dictionary of Algorithms and Data Structures, 2020-11-23)
  2. Weekday function (Microsoft Support)
  3. Weekday (Google Docs Editors Help)
  4. Leap Years (U.S. Naval Observatory (USNO))
  5. Introduction to Calendars (U.S. Naval Observatory (USNO))
  6. Calendars and their History (NASA, 2012-10-14)
  7. Which years are leap years and can you have leap seconds? (Royal Museums Greenwich)

More in Calendar Guides

All Calendar Guides stories →
  1. What Is the 100th Day of the Year? April 10, or April 9 in Leap Years
  2. How Many Days Are Left in the Year? The Formula, Plus the Count From Oct. 30, 2026
  3. How to Print a Calendar PDF at Actual Size: Print Settings for Edge, Mac and Home Printers
  4. Monday Start vs Sunday Start Calendar: Same Dates, Different First Column
  5. What Is a Fiscal Year? Federal, State and UK Dates With Quarter Tables