Calculates the fraction of the year represented by the number of whole days between two dates.
ไวยากรณ์
YEARFRAC(start_date, end_date, [basis])อาร์กิวเมนต์
start_dateจำเป็น
วันที่เริ่มต้น
end_dateจำเป็น
The ending date.
basisไม่บังคับ
The type of day count basis to use (0 = US 30/360, 1 = Actual/Actual, etc.).
The YEARFRAC function is used to identify the proportion of a year between a start date and an end date. It is commonly used to calculate accrued interest or other financial metrics that rely on time periods.
=YEARFRAC("2023-01-01", "2023-07-01", 1)→0.49589Calculates the fraction of the year for the first half of 2023 using the actual/actual basis.
Enter the dates
Ensure your start and end dates are in a format Excel recognizes as a date.
Apply the function
Type =YEARFRAC(start_date, end_date) into a cell to get the result.
It determines how the number of days in a year is calculated, which affects the final fraction.