DATEDIF
Date

Calculates the number of days, months, or years between two dates

Syntax:

=DATEDIF(start_date, end_date, unit)

Example:

=DATEDIF("1/1/2023", "12/31/2023", "Y")