# Excel DAY function

## Summary

The Excel DAY function is designed to extract the day of the month from any given date value, returning it as a number between 1 and 31. It’s a straightforward and useful function for breaking down dates into their individual components, particularly the day part, which can then be used in further calculations or analyses.
##### Syntax
```				```
=DAY(date)
```
```
• date: The date from which you want to extract the day. It must be a valid Excel date.
##### Return value
A number (1-31) representing the day of the month from the given date.

## How to use

To use the DAY function, simply provide a valid Excel date as the argument. The function will return the day part of that date as a number. It’s particularly useful when you need to isolate the day component of a date for comparison, calculation, or as input into another function.

## Examples

##### Simple DAY

Extracting Day from a Date: To retrieve the day component from a specific date:

```				```
=DAY("2020-12-25")
```
```
This formula extracts and returns the day part of December 25, 2020, which is 25.
##### DAY and DATE
Creating a Specific Date with Dynamic Day: To dynamically create a date with a specific month and year, but varying day:
```				```
=DATE(2021, 7, DAY(A1))
```
```
Assuming A1 contains a date, this formula uses the day from A1 and constructs a new date in July 2021 with that day.
##### DAY with IF
Day-Based Messaging: To display a message based on the day of the month:
```				```
=IF(DAY(B1)=1, "First Day!", "Not the First Day")
```
```
This formula checks if the day in B1 is the first of the month and returns “First Day!” if true, or “Not the First Day” otherwise.
##### DAY for Age Calculation
Calculating Days Until Next Birthday: To calculate how many days are left until the next birthday from a birth date:
```				```
=DAY(TODAY()) - DAY(C1)
```
```
Assuming C1 contains a birthdate, this formula calculates the number of days from today until the next occurrence of the day in C1.