# DAY

Formulas / DAY
Retrieve the day as a number from a date.
`=DAY(date)`
• date - required

## Examples

• `=DAY(A1)`

The DAY function is used to extract the day number from a date and display it in a cell. For example this formula would extract the day number from the date in cell A1 and display it in the cell in which the formula is entered.

• `=DATE(2020,MONTH(A1),DAY(A1))`

The DAY function can also be used to feed the day value into the DATE function to change the year of a date, but leaving the month and day as-is. For example, this formula would feed the day value from cell A1 into the DATE function, which would then change the year to 2020, but keep the month and day unchanged.

• `=DAY(A2)-DAY(A1)`

The DAY function can also be used to calculate the number of days between two dates. This example would calculate the number of days between the dates stored in cells A1 and A2.

• `=DAY(A2)-DAY(A1)/30`

The DAY function can also be used to calculate the number of months between two dates. For example this would calculate the number of months between the dates stored in cells A1 and A2.

## Summary

The DAY function in Sourcetable allows users to return the day of the date entered as a number. It requires an argument of a date, which should be entered using the DATE function, as Sourcetable calculates dates using sequential serial numbers.

• The DAY function takes a date argument as the required input.
• The date argument must be a valid Sourcetable date, otherwise the function will return #VALUE!.

What is the DAY function?
The DAY function is a function in Sourcetable that returns the day of a date as a number.
What does the DAY function take as an argument?
The DAY function takes a serial number as its argument.
What is the serial number?
The serial number is the date to find.
How does Sourcetable calculate dates?
Sourcetable calculates dates as sequential serial numbers.
Can the DAY function return dates entered as text?
Yes, the DAY function can return dates entered as text.
What format does the DAY function output?
The DAY function outputs Gregorian values regardless of the format of the supplied date.