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?

  1. DATE()
  2. DATEDIF()
  3. DATEVALUE()
  4. 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

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.