Files
IronCalc/docs/src/functions/date_and_time/day.md
2025-01-01 11:44:44 +01:00

2.7 KiB

layout, outline, lang
layout outline lang
doc deep en-US

DAY function

::: warning Note: This draft page is under construction 🚧 :::

Overview

DAY is a function of the Date and Time category that extracts the day of the month from a valid date serial number, returning a number in the range [1, 31].

Usage

Syntax

DAY(date) => day

Argument descriptions

  • date (number, required). The date for which the day of the month is to be calculated, expressed as a serial number in the range [0, 2958465]. The value 0 corresponds to the date 1899-12-30, while 2958465 corresponds to 9999-12-31.

Additional guidance

If the supplied date argument has a fractional part, DAY uses its floor value.

Returned value

DAY returns an integer number in the range [1, 31], that is the day of the month according to the Gregorian calendar.

Error conditions

  • In common with many other IronCalc functions, DAY propagates errors that are found in its argument.
  • If no argument, or more than one argument, is supplied, then DAY returns the #ERROR! error.
  • If the value of the date argument is not (or cannot be converted to) a number, then DAY returns the #VALUE! error.
  • For some argument values, DAY may return the #DIV/0! error.
  • If date is less than 0, or greater than 2,958,465, then DAY returns the #NUM! error.
  • At present, DAY does not accept a string representation of a date literal as an argument. For example, the formula =DAY("2024-12-31") returns the #VALUE! error.

Details

IronCalc utilizes Rust's chrono crate to implement the DAY function.

Examples

See some examples in IronCalc.