DATEDIF Google Sheet Formula
Generate Google Sheet DATEDIF Formulas in seconds
Interactive Formula Generator
Formula Generator
Create complex Google Sheets formulas with natural language. Simply describe what you want to calculate.
Upgrade to Sheet Alchemy Pro
Get advanced formulas, batch processing, and priority support
Input
Result
Your formula will be displayed here:
Your formula will appear here
Describe what you want to calculate and click Generate
Pro Features Available
Sheet Alchemy Pro includes additional advanced features to enhance your formula generation.
Advanced Formulas
Complex array formulas and dynamic ranges
Batch Processing
Generate multiple formulas at once
Unlimited History
Save and organize all your formulas
DATEDIF Formula Syntax
Example Use Case
Calculating the difference between two dates in various units
Understanding the DATEDIF Formula
The DATEDIF function in Excel calculates the difference between two dates in your choice of units (days, months, years, etc.). It's a date calculation tool for measuring time spans—like determining age, tenure, or duration in specific units.
DATEDIF("1/1/2023", "12/31/2023", "m") returns 11, counting the months between dates. It takes start_date, end_date, and unit arguments ("d"=days, "m"=months, "y"=years, "ym"=months excluding years, "yd"=days excluding years, "md"=days excluding months and years), supporting various time measurements.
Why Use DATEDIF?
DATEDIF offers specialized date differencing—think age calculations or service intervals. Its unit options allow precise control over how differences are reported, making it ideal for HR applications, project timelines, or anywhere specific time measurements matter.
Example with Sample Data
Date Range, Unit | Formula | Result |
---|---|---|
1/1/2023 to 12/31/2023, "d" | =DATEDIF("1/1/2023", "12/31/2023", "d") | 364 (days) |
6/1/2020 to 8/15/2023, "y" | =DATEDIF("6/1/2020", "8/15/2023", "y") | 3 (complete years) |
6/1/2020 to 8/15/2023, "ym" | =DATEDIF("6/1/2020", "8/15/2023", "ym") | 2 (months excluding years) |
DATEDIF calculates time spans: 11 months between Jan and Dec, 3 complete years in a longer span. It's a date difference specialist.
Explore More Google Sheet Formulas
YEAR
Extracting the year component from a date value
Learn moreDDB
Calculating asset depreciation using the double-declining balance method
Learn moreIPMT
Calculating the interest payment for a specific period of a loan
Learn moreMEDIAN
Finding the middle value in a range for central tendency
Learn moreNPV
Calculating the net present value of an investment based on a series of cash flows
Learn moreISOWEEKNUM
Finding the ISO week number of a date for standardized week numbering
Learn moreDAY
Extracting the day of the month from a date value
Learn moreEOMONTH
Calculating the last day of a month that is a specified number of months from a date
Learn moreUnlock the Full Power of Sheet Alchemy
Get access to all our formula generators, script generators, and conversion tools with a free Sheet Alchemy account.