YEARFRAC
Date

Calculates the fraction of the year represented by the number of whole days between two dates

Syntax:

=YEARFRAC(start_date, end_date, [basis])

Example:

=YEARFRAC("1/1/2023", "12/31/2023")