DAY Function in Excel & Sheets

Extract the day number from any date with the DAY function. Learn syntax, examples, and solutions to common errors for both Excel and Google Sheets.

ExcelExcel
Google SheetsGoogle Sheets
date-time
beginner
Syntax Preview
ExcelExcelGoogle SheetsGoogle Sheets
=DAY(serial_number)
Quick Answer
Comprehensive Explanation

Practical Examples

Basic Date Extraction

Extract the day from a specific date

Result: 15

Extract Day from Cell Reference

Get the day from a date stored in another cell

Result: 28

Payment Due Date Checker

Check if payment is due on the 15th or 30th of the month

Result: Payment Due

Days Until Month End

Calculate remaining days in the current month

Result: 16

Birthday Day Extractor

Extract birth day for anniversary reminders

Result: 23

Dynamic Report Date Header

Create a formatted date header showing 'Day X of Month'

Result: Day 28 of September

Billing Cycle Calculator

Determine billing cycle based on service start day

Result: Cycle 2 (16-31)
How to Use DAY - Step by Step

Common Errors and Solutions

#VALUE!

DAY function returns #VALUE! error

Cause:

The input provided is not recognized as a valid date by Excel/Sheets

Solution:

1. Verify the date format matches your regional settings 2. Check for extra spaces or hidden characters using TRIM() 3. Ensure text dates are properly formatted (use DATEVALUE if needed) 4. Convert text to dates using DATE function or Text to Columns

Prevention:

Always validate date inputs using ISDATE (Sheets) or ISNUMBER (Excel) before using DAY

Frequency: 45%

Example:

#NAME?

Excel doesn't recognize the DAY function

Cause:

Typically caused by typos in the function name or using DAY in a very old Excel version

Solution:

1. Check spelling - ensure it's DAY not DAYS or DY 2. Verify Excel version supports the function (all modern versions do) 3. Check if macros or add-ins are interfering 4. Try in a new workbook to rule out corruption

Prevention:

Use Excel's autocomplete feature when typing formulas

Frequency: 20%

Example:

Incorrect Result (Always 0 or 1)

DAY returns unexpected low numbers like 0 or 1

Cause:

Excel is interpreting your date as a number close to zero (January 1900 dates)

Solution:

1. Check if your dates are stored as text (left-aligned in cells) 2. Verify date system settings (1900 vs 1904 date system) 3. Use DATEVALUE to convert text dates: =DAY(DATEVALUE(A2)) 4. Re-enter dates in proper format

Prevention:

Format cells as Date before entering date values

Frequency: 25%

Example:

Regional Date Format Issues

DAY returns wrong day due to MM/DD vs DD/MM confusion

Cause:

Date interpretation differs between regions (US vs European formats)

Solution:

1. Use unambiguous date formats like "15-Mar-2025" 2. Use DATE function: =DAY(DATE(2025,3,15)) 3. Check Windows/Mac regional settings 4. Use ISO format: "2025-03-15"

Prevention:

Standardize date entry using DATE function or ISO format

Frequency: 10%

Example:

Best Practices and Advanced Tips

Create powerful date analyses by combining DAY with MONTH and YEAR. For example, reconstruct dates with specific days: =DATE(YEAR(A2), MONTH(A2), 15) always returns the 15th of the original month.

Use DAY in conditional formatting rules to highlight specific days. For instance, highlight all dates that fall on the 1st of any month with the formula =DAY($A2)=1

Remember that Excel dates start from January 1, 1900 (serial number 1) and go up to December 31, 9999. Dates outside this range will cause errors. Google Sheets has a similar but slightly different date system.

Wrap DAY in IFERROR when working with user-input dates or imported data to handle invalid dates gracefully. This prevents errors from propagating through your spreadsheet.

While DATEDIF is typically used for age, you can use DAY to check if someone's birthday has passed this month: =IF(DAY(birthday)<=DAY(TODAY()), "Passed", "Upcoming")

DAY is a lightweight function with minimal performance impact. When processing thousands of dates, it's still efficient. However, combine with IFERROR only when necessary as error handling adds overhead.

DAY vs Alternative Functions
Real-World Applications
Frequently Asked Questions

Need Help with DAY Function in Excel & Sheets?

Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.

Example Excel formula:

Related Formulas

DATE Function in Excel

Master the DATE function in Excel to create dates from year, month, and day values. Learn syntax, examples, errors, and best practices.

beginner
date-time
ExcelExcel
Google SheetsSheets
Validated
DATEVALUE Function in Excel

The DATEVALUE function converts text dates to Excel serial numbers for calculations. Learn syntax, examples, common errors and best practices.

intermediate
date-time
ExcelExcel
Google SheetsSheets
Validated
TODAY Function

Master the TODAY function to insert dynamic current dates that update automatically. Learn practical examples and avoid common errors.

beginner
date-time
ExcelExcel
Google SheetsSheets
Validated
WEEKDAY Function

Master the WEEKDAY function to return the day of week as a number. Learn syntax, examples, and error solutions for Excel and Google Sheets calculations.

intermediate
date-time
ExcelExcel
Google SheetsSheets
Validated