YEARFRAC

The result is the number of the years (including fractional part) between StartDate and EndDate.

語法

YEARFRAC(StartDate; EndDate; Basis)

StartDateEndDate 是兩個日期值。

Basis 由選項清單中選擇,同時表示年度的計算方式。

基準

計算

0 或缺少

美國方法 (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) 傳回 0.50。