Date and time functions

DAY

Matches all 10,158 recorded answers

Recorded: 10,153 in the answer bank and 5 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicDAY
BulgarianDAY
CzechDEN
DanishDAY
GermanDAY
GreekDAY
English (Australia)DAY
English (United Kingdom)DAY
English (United States)DAY
SpanishDAY
EstonianPÄEV
FinnishPÄIVÄ
FrenchDAY
HebrewDAY
CroatianDAY
HungarianDAY
IndonesianDAY
ItalianDAY
JapaneseDAY
KoreanDAY
LithuanianDAY
LatvianDAY
NorwegianDAG
DutchDAY
PolishDAY (dzień)
Portuguese (Brazil)DAY
Portuguese (Portugal)DIA
RomanianDAY
RussianDAY
SlovakDEŇ
SlovenianDAN
Serbian (Latin)DAN
SwedishDAY
Thaiวัน
TurkishGÜN
UkrainianДЕНЬ
VietnameseDAY
Chinese (Simplified)DAY
Chinese (Hong Kong)DAY
Chinese (Traditional)DAY

Names from Microsoft's support site.

What it does

DAY(serial_number)

DAY projects a date serial onto its day-of-month component: floor the serial, map ⌊serial⌋ to a calendar day under the workbook's date system (see FUNC.DATE), and return that day's day-of-month as an integer, documented as 1 through 31.

Of the three decomposers this is the one where Excel's serial line stops agreeing with the calendar. Serial 60 denotes 29 February 1900, a date that did not exist; the day-of-month it reports is 29 in a February that had 28 days. Serial 0 denotes a "0 January 1900" that is not a day at all. So the documented 1–31 range is the range for real days; the phantoms sit outside the calendar the range describes.

Arguments

DAY(serial_number) — one required argument, the date whose day-of-month is wanted.

Microsoft's category-wide guidance applies: pass a serial from DATE, from another formula, or from a cell already holding a date, rather than text, whose interpretation depends on the locale's date order. Argument coercion is the ordinary scalar behaviour described in coercion and lifting.

Note that DAY takes a date, not a day count. DAY(45) is the day-of-month of 14 February 1900, not the number 45 reduced somehow — a confusion that shows up whenever someone reaches for DAY when they wanted DAYS.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

Returns a Number, documented as 1…31 for real calendar days.

  • Fractional serials are floored; time of day is discarded.
  • Serial 60 is the diagnostic input for this whole category. If the implementation carries the phantom leap day, DAY(60) is 29 and DAY(59)/DAY(61) are 28 and 1. If instead it delegates to a real calendar without the shift, the answers slide by one. Nothing else in the date category exposes the artefact this directly.
  • Very large serials. The battery's maximum-double row returns a number rather than an error; see below.

Errors

As documented for this category:

  • #NUM! when serial_number is out of range for the workbook's date-base value; negative serials are the unambiguous case.
  • #VALUE! when the argument will not convert to a number — ordinary coercion, not a DAY rule.
  • An error argument propagates.

How to implement

Notes for implementers

  1. Implement the artefact as a coordinate shift, once. Convert serial to a proleptic Gregorian day number by subtracting 1 for serials ≥ 61, do real calendar arithmetic, and special-case serials 0 and 60 on the way out. Trying to teach a calendar library that 1900 was a leap year corrupts every other computation that library performs.
  2. Share the serial→(y,m,d) routine with YEAR and MONTH; three separate derivations will eventually disagree at serial 60.
  3. Decide what DAY(60) returns and write it down. It is the one value in this function that a reasonable engineer could get "right" in two different ways, and it is therefore the first thing a compatibility test should pin.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

DAY · 3 lines · calc-func/src/catalogue/dates.rs on GitHub
5 day_fn "DAY" (1, 1) [V "serial_number"] |s, a, sv| {
    of_date(s, a, |x| k::serial_to_ymd(x).map(|(_, _, d)| d as f64))
}

Kernels shared with other functions

Argument and result plumbing

  • num catalogue/kit
  • out catalogue/kit

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
20430Windows, 64-bit, CPU not recorded10,153

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

10,153 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

Relationships

  • YEAR, MONTH — the sibling projections; together they invert DATE.
  • DAYS — the confusable. DAY reads a component of one date; DAYS measures the interval between two. The names are one character apart and the meanings are unrelated.
  • EOMONTH — DAY(EOMONTH(s,0)) is the idiomatic "how many days are in this month" formula, and is the standard way people discover the 1900 artefact by accident: DAY(EOMONTH(DATE(1900,2,1),0)) asks a question with two possible right answers.
  • WEEKDAY — day of week rather than day of month, and the function Microsoft's leap-year article names as the one that returns incorrect values before 1 March 1900.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents