Add-in Functions

The following describes and lists some of the available add-in functions.

アドインコンセプト

You will also find a description of the LibreOffice Calc add-in interface in the Help. In addition, important functions and their parameters are described in the Help for the .

用意されているアドイン

LibreOffice には、LibreOffice Calc のアドインインタフェースの例が含まれています。

分析関数 1

分析関数 2

DAYSINMONTH

入力した日付を含む月の日数を計算します。

Syntax

DAYSINMONTH(日付)

日付 は、必要な年の各月の任意の日付です。日付パラメーターは、LibreOffice のロケール設定に従う有効な日付とします。

Example

A1 に 1968 年 2 月の有効な日付、1968-02-17 が含まれている場合、=DAYSINMONTH(A1) は 29 日を返します。

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.DAYSINMONTH

tip

DAYSINYEAR

入力した日付を含む年の日数を計算します。

Syntax

DAYSINYEAR(日付)

日付 は、各年の任意の日付です。日付パラメーターは、LibreOffice のロケール設定に従う有効な日付とします。

Example

A1 に 1968 年の有効な日付、1968-02-29 が含まれている場合、=DAYSINYEAR(A1) は 366 日を返します。

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.DAYSINYEAR

tip

ISLEAPYEAR

指定した日付の年が、閏年かどうかを調べます。 閏年の場合は値 1 (TRUE)、そうでない場合は 0 (FALSE) を返します。

Syntax

ISLEAPYEAR("日付")

Date specifies whether a given date falls within a leap year. The Date parameter must be a valid date.

warning

Microsoft Excel wrongly assumes year 1900 to be a leap year and considers the inexistent day of 1900-02-29 as valid in date calculations. Dates prior to 1900-03-01 are therefore different in Excel and Calc.


Example

A1 にロケール設定内の有効な日付 1968 年 2 月 29 日を表す 1968-02-29 が含まれている場合、=ISLEAPYEAR(A1) は 1 を返します。

You may also use =ISLEAPYEAR(DATE(1968;2;29)) or =ISLEAPYEAR("1968-02-29") giving the date string in the ISO 8601 notation.

=ISLEAPYEAR(2/29/68) は最初 29 を 68 で割った数で 2 を割り、連続する日付番号としてこの小さい数から ISLEAPYEAR を計算するので、絶対に使用しないでください。

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.ISLEAPYEAR

tip

MONTHS

2 つの日付の間の月数を返します。

Syntax

MONTHS(開始日; 終了日; タイプ)

開始日 は、最初の日付です。

終了日 は、2 番目の日付です。

タイプ は違いの種類を計算します。使用可能な値は、0 (間隔) と 1 (暦月) などです。

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.MONTHS

tip

ROT13

アルファベット文字を 13 文字ずらして文字列を暗号化します。Z の後は A に戻ります。暗号化された文字列にもう一度この関数を適用すると、元の文字列に戻ります。

Syntax

ROT13(文字列)

テキスト は、暗号化される文字列です。ROT13(ROT13(テキスト)) は、コードを復号化します。

Example

=ROT13("Gur Qbphzrag Sbhaqngvba jnf sbhaqrq va Frcgrzore 2010.") returns the string "The Document Foundation was founded in September 2010.". Notice how spaces, digits, and full stops are unaffected by ROT13.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.ROT13

tip

Refer to the ROT13 wiki page for more details about this function.


WEEKS

2 つの日付の間の週数を返します。

Syntax

WEEKS(開始日; 終了日; タイプ)

StartDate is the start date in the interval.

EndDate is the end date in the interval. The end date must be greater than the start date, or else an error is returned.

Type specifies the type of difference to be calculated. Possible values are 0 (time interval) or 1 (calendar weeks).

If Type = 0 the function will assume that 7 days is equivalent to one week without considering any specific day to mark the beginning of a week.

If Type = 1 the function will consider Monday to be the first day of the week. Therefore, except for the start date, each occurrence of a Monday in the interval is counted as an additional week.

note

This function considers Monday to be the first day of the week regardless of the current locale settings.


Example

In the following examples, dates are passed as strings. However, they can also be stored in separate cells and be passed as references.

=WEEKS("01/12/2022","01/17/2022",0) returns 0 because Type was set to 0 and there are only 5 days in the interval.

=WEEKS("01/12/2022","01/19/2022",0) returns 1 because Type was set to 0 and there are 7 days in the interval.

=WEEKS("01/12/2022","01/17/2022",1) returns 1 because Type was set to 1 and the interval contains a Monday, since 01/12/2022 is a Wednesday and 01/17/2022 is a Monday.

=WEEKS("01/10/2022","01/15/2022",1) returns 0 because Type was set to 1 and the interval does not contain any Mondays, except for the start date.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.WEEKS

tip

WEEKSINYEAR

入力した日付を含むその年の週数を計算します。 週数は、次のように定義されます。 2 つの年にわたる週は、その週の日を多く含む方の年に加えられます。

Syntax

WEEKSINYEAR(日付)

日付 は、各年の任意の日付です。日付パラメーターは、LibreOffice のロケール設定に従う有効な日付とします。

Example

A1 に 1970 年の有効な日付、1970-02-17 が含まれている場合、WEEKSINYEAR(A1) は 53 を返します。

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.WEEKSINYEAR

tip

YEARS

2 つの日付の間の年数を返します。

Syntax

YEARS(開始日; 終了日; タイプ)

開始日 は、最初の日付です。

終了日 は、2 番目の日付です。

タイプ は違いの種類を計算します。使用可能な値は、0 (間隔) と 1 (暦月) です。

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.YEARS

tip

LibreOffice API によるアドイン

Add-ins can also be implemented through the LibreOffice API.

ご支援をお願いします!