LibreOffice 25.8 Help
The result is the number of the years (including fractional part) between StartDate and EndDate.
YEARFRAC(StartDate; EndDate [; Basis])
StartDate 與 EndDate 是兩個日期值。
Basis 由選項清單中選擇,同時表示年度的計算方式。
| 基準 | 計算 | 
|---|---|
| 0 or missing | 美國方法 (NASD),12 個月,每月 30 天 | 
| 1 | 月中確實的天數,一年中確實的天數 | 
| 2 | 月中確實的天數,一年有 360 天 | 
| 3 | 月中確實的天數,一年有 365 天 | 
| 4 | 歐洲方法,12 個月,每月 30 天 | 
2008-01-01 到 2008-07-01 是 2008 年的幾分之幾?
=YEARFRAC("2008-01-01"; "2008-07-01";0) returns 0.50.