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.
=DAY(serial_number)Quick Answer
DAY function DAY function is a date-time function in Excel and Google Sheets that extracts the day of the month from a date as a number between 1 and 31. It returns the day component of any valid date, making it essential for date analysis, filtering, and calculations.
=DAY(date)Practical Examples
Basic Date Extraction
Extract the day from a specific date
Extract Day from Cell Reference
Get the day from a date stored in another cell
Payment Due Date Checker
Check if payment is due on the 15th or 30th of the month
Days Until Month End
Calculate remaining days in the current month
Birthday Day Extractor
Extract birth day for anniversary reminders
Dynamic Report Date Header
Create a formatted date header showing 'Day X of Month'
Billing Cycle Calculator
Determine billing cycle based on service start day
Common Errors and Solutions
DAY function returns #VALUE! error
The input provided is not recognized as a valid date by Excel/Sheets
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
Always validate date inputs using ISDATE (Sheets) or ISNUMBER (Excel) before using DAY
Example:
Excel doesn't recognize the DAY function
Typically caused by typos in the function name or using DAY in a very old Excel version
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
Use Excel's autocomplete feature when typing formulas
Example:
DAY returns unexpected low numbers like 0 or 1
Excel is interpreting your date as a number close to zero (January 1900 dates)
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
Format cells as Date before entering date values
Example:
DAY returns wrong day due to MM/DD vs DD/MM confusion
Date interpretation differs between regions (US vs European formats)
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"
Standardize date entry using DATE function or ISO format
Example:
Best Practices and Advanced Tips
Combine with Other Date Functions
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.
Create Day-Based Conditional Formatting
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
Date Serial Number Limits
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.
Always Validate Date Inputs
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.
Use for Age Calculations
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")
Performance with Large Datasets
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.
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
Master the DATE function in Excel to create dates from year, month, and day values. Learn syntax, examples, errors, and best practices.
The DATEVALUE function converts text dates to Excel serial numbers for calculations. Learn syntax, examples, common errors and best practices.
Master the TODAY function to insert dynamic current dates that update automatically. Learn practical examples and avoid common errors.
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.