How to Use the DAY Function in Excel
Today, we’ll explore a fundamental function in both Microsoft Excel and Google Sheets that pertains to handling dates—the DAY function. This function is particularly useful for extracting the day of the month from a specific date value. We’ll take a closer look at how it operates and provide some practical examples of its usage.
Syntax:
The syntax for the DAY function is straightforward:
=DAY(serial_number)
serial_number
: This parameter represents the date from which you want to extract the day. You can input it either as a date enclosed in quotes, or as a reference to a cell that contains a date.
Examples:
Below are a few examples to illustrate the utility of the DAY function:
Example 1 – Using a Date:
Assume cell A1 holds the date 25-May-2022
. To extract the day from this date, the formula would be:
=DAY(A1)
Date (A1) | DAY Function Result |
---|---|
25-May-2022 | 25 |
In this scenario, the DAY function returns 25
, which corresponds to the day of the month for the date in cell A1.
Example 2 – Using a Date Entered in the Formula:
Alternatively, you can directly insert a date into the DAY function itself. For instance:
=DAY("2022-09-15")
This formula will produce 15
, extracting the day from the date 15th September 2022
.
Example 3 – Cell Reference:
You can also employ the DAY function via a reference to a cell that holds a date. If cell B1 is populated with 10-Nov-2022
, then the formula:
=DAY(B1)
Would result in 10
, representing the day of the month for the date specified in cell B1.
These examples underscore the flexibility of the DAY function in Excel and Google Sheets, providing a straightforward method to break down dates into their specific components for more detailed analysis.
More information: https://support.microsoft.com/en-us/office/day-function-8a7d1cbb-6c7d-4ba1-8aea-25c134d03101