Difference between revisions of "User:Syranzi/Documentation/How Tos/Calc: YEARS function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_YEARS_function 日本語訳、作業中)
(No difference)

Revision as of 13:45, 2 February 2011

YEARS

YEARS

Returns the number of years between two dates.

2 つの日の間にある年数を返します。

This function is only available if the Analysis AddIn is installed.

この機能は、Analysis AddIn (分析アドイン) がインストールされている場合のみ使用可能です。


Syntax:

構文:

YEARS(startdate; enddate; mode)

If mode is 0, YEARS returns the number of whole years between startdate and enddate, day/month to day/month.

YEARS(開始日付; 終了日付; 計算方法)

「計算方法」0 であれば、 YEARS「開始日付」「終了日付」の間にある日数と月数をもとにして、全年数を返します。
If mode is 1, YEARS identifies the year that startdate and enddate each lie in, and returns the difference between those years. In other words it returns YEAR(enddate) - YEAR(startdate)
「計算方式」1 であれば、 YEARS「開始日付」「終了日付」がそれぞれ属する年を特定して、両年の差を返します。YEAR(終了日付) - YEAR(開始日付) と同じ値を返すことになります。
If startdate is after enddate the result will be negative.
「開始日付」「終了日付」より後の日であれば、結果は負数になります。

Example:

例:

YEARS("2009-04-03"; "2011-11-17"; 0)

returns 2.

YEARS("2009-04-03"; "2011-11-17"; 0)

「2」を返します。

YEARS("2011-02-28"; "2012-02-28"; 0)

returns 1. 2012 is a leap year, but 28th February to 28th February is classed as a whole year.

YEARS("2011-02-28"; "2012-02-28"; 0)

「1」を返します。2012 年は、うるう年です。しかし、2 月 28 日から翌 2 月 28 日までは、間隔が1 年あるものとして数えられます。

YEARS("2012-02-29"; "2013-02-28"; 0)

returns 0. 2012 is a leap year, but 29th February to 28th February is not classed as a whole year, even though both dates are the last day of February.

YEARS("2012-02-29"; "2013-02-28"; 0)

「0」を返します。2012 年は、うるう年です。しかし、2 月 29 日から翌 2 月 28 日は、どちらも 2 月の最終日とはいえ、間隔が 1 年あるとは数えられません。

YEARS("2009-04-03"; "2011-11-17"; 1)

returns 2.

YEARS("2009-04-03"; "2011-11-17"; 1)

「2」を返します。

YEARS("2009-12-31"; "2010-01-01"; 1)

returns 1. Even though there is only one day between the dates, they lie in different years.

YEARS("2009-12-31"; "2010-01-01"; 1)

「1」を返します。開始日付と終了日付は 1 日しか離れていませんが、属する年が異なるためです。

Issues:

課題:

  • This function is not available in Excel.
  • Excel では使用されていない関数です。

Template:Documentation/SeeAlso

Personal tools