User:Syranzi/Documentation/How Tos/Calc: MONTHS function

From Apache OpenOffice Wiki
Jump to: navigation, search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

MONTHS

MONTHS

Returns the number of months between two dates.

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

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

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

Syntax:

構文:

MONTHS(startdate; enddate; mode)

if mode is 0, MONTHS returns the number of whole months between startdate and enddate, day of the month to day of the month (see examples).

MONTHS(開始日付; 終了日付; 計算方式)

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

Example:

例:

MONTHS("2010-04-03"; "2011-06-17"; 0)

returns 14, the number of months between 3 April 2010 and 17 June 2011.

MONTHS("2010-04-03"; "2011-06-17"; 0)

「14」を返します。2010 年 4 月 3 日と 2011 年 6 月 17 日の間にある月数です。

MONTHS("2010-03-31"; "2010-04-30"; 0)

returns 0. 31 March to 30 April is not considered a whole month, even though they are both the last day of their months.

MONTHS("2010-03-31"; "2010-04-30"; 0)

「0」を返します。3 月 31 日と 4 月 30 日は各月の最終日ですが、間隔は 1 ヵ月として扱われません。

MONTHS("2010-03-31"; "2010-06-30"; 0)

returns 2. Even though both dates are the last day of their months, the last month is not counted, because the day is less than 31.

MONTHS("2010-03-31"; "2010-06-30"; 0)

「2」を返します。どちらも各月の最終日ですが、最終月は日数が 31 日より少ないので計上されません。

MONTHS("2010-04-03"; "2011-06-17"; 1)

returns 14, the number of months between April 2010 and June 2011.

MONTHS("2010-04-03"; "2011-06-17"; 1)

「14」を返します。2010 年 4 月と 2011 年 6 月の間にある月数です。

MONTHS("2010-03-31"; "2010-04-01"; 1)

returns 1. Even though the dates are just one day apart, they lie in different months.

MONTHS("2010-03-31"; "2010-04-01"; 1)

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

Issues:

課題:

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



See Also

関連項目

Personal tools