Home »
MCQs »
Microsoft Excel MCQs
Which function is used to get days, months, or years between two dates?
25. Which function is used to get days, months, or years between two dates?
- DATE()
- DATEDIF()
- DATEVALUE()
- CURDATE()
Answer: B) DATEIF()
Explanation:
The DATEDIF() function is used to get days, months, or years between two dates.
Syntax:
=DATEDIF (start_date, end_date, unit)
Example:
=DATEDIF("26-08-2020","26-08-2022","y") // Returns 2
=DATEDIF("26-08-2020","26-08-2022","m") // Returns 24
=DATEDIF("26-08-2020","26-08-2022","d") // Returns 730