The Problem
You have year, month, and day in separate columns (A2 has year 2025, B2 has month 1, C2 has day 15) and need to combine them into a single date. Or you need to create a date from calculated values.
The Easy Way: Use SheetXAI
If you don't want to mess with formulas, the fastest way to do this is simply by asking.
With SheetXAI, you can open the sidebar and type:
Create a date from the year in A2, month in B2, and day in C2.
SheetXAI will instantly write the formula or script for you and fill the cells. It handles the syntax so you can focus on the result.
The Manual Way: The Formulas You Need
To do this manually, you need to use: DATE.
1. DATE
Creates a date from year, month, and day values. Combines separate year, month, and day numbers into a single date value.
Syntax: =DATE(year, month, day)
- year: The year (4-digit number like 2025).
- month: The month (1-12, where 1=January, 12=December).
- day: The day of the month (1-31).
Example: DATE(2025, 1, 15) returns January 15, 2025 as a date value.
Understanding the Logic
- DATE: Combines year, month, and day into a single date value.
Key points:
- Takes three separate numbers (year, month, day) and creates a date
- Returns a date serial number that Excel recognizes as a date
- Can use cell references: DATE(A2, B2, C2)
- Can use calculated values: DATE(2025, MONTH(TODAY()), 1) for first day of current month
- Handles month overflow: DATE(2025, 13, 1) becomes January 1, 2026
- Handles day overflow: DATE(2025, 1, 32) becomes February 1, 2025
Common use cases:
- Combine separate year/month/day columns into dates
- Create dates from calculated values (e.g., first day of month)
- Build dates dynamically based on other data
- Fix dates that were imported as text
The Final Formula:
=DATE(A2, B2, C2)
Conclusion
Now you know the "classic" way to solve this using formulas. It's a great skill to have.
But for those times when you just want the job done without the mental math, SheetXAI is there to help.
Related Guides
- YEAR, MONTH, and DAY in Excel - Extract date components
- TODAY and NOW in Excel - Get current date and time
- How to Calculate Days Between Dates in Excel - Date calculations
- Excel AI Guide - Learn how AI can automate your Excel workflows
- AI Spreadsheet Tools - Discover how AI transforms spreadsheet work