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.

Функции для анализа (часть первая)

Функции для анализа (часть вторая)

DAYSINMONTH

Вычисление количества дней в месяце, на который пришлась указанная дата.

Syntax

DAYSINMONTH(Дата)

Дата - любая дата в соответствующем месяце требуемого года. Параметр "Дата" должен представлять собой допустимую дату в соответствии с настройками локали LibreOffice.

Example

=DAYSINMONTH(A1) возвращает 29 дней, если ячейка A1 содержит значение 1968-02-17, которое является допустимой датой для февраля 1968 года.

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

DAYSINYEAR

Вычисляет количество дней в году, на который пришлась указанная дата.

Syntax

DAYSINYEAR(Дата)

Дата - любая дата в соответствующем году. Параметр "Дата" должен представлять собой допустимую дату в соответствии с настройками локали LibreOffice.

Example

=DAYSINYEAR(A1) возвращает 366 дней, если ячейка A1 содержит значение 1968-02-29, которое является допустимой датой для 1968 года.

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

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.

Example

=ISLEAPYEAR(A1) возвращает значение 1, если ячейка A1 содержит значение 1968-02-29, поскольку дата 29 февраля 1968 допустима при выбранных параметрах языка.

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 делится на 2, затем - на 68, после чего функция 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

MONTHS

Возвращает количество месяцев между двумя датами.

Syntax

MONTHS(Начальная дата; Конечная дата; Тип)

Начальная дата является первой датой.

Конечная дата является второй датой.

Тип вычисляет тип различия. Возможные значения включают 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

ROT13

Служит для шифрования строки символов путём их перемещения на 13 позиций в алфавите. После буквы Я алфавит начинается снова (повторяется). При повторном применении функции шифрования к полученному коду можно произвести расшифровку.

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

Возвращает количество недель между двумя датами.

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

WEEKSINYEAR

Вычисляет количество недель в году, на который пришлась указанная дата.Количество недель определяется следующим образом: неделя, выпадающая на два года, прибавляется к году, к которому относится большее число дней этой недели.

Syntax

WEEKSINYEAR(Дата)

Дата - любая дата в соответствующем году. Параметр "Дата" должен представлять собой допустимую дату в соответствии с настройками локали LibreOffice.

Example

WEEKSINYEAR(A1) возвращает значение 53, если ячейка A1 содержит значение 1970-02-17, которое является допустимой датой для 1970 года.

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

YEARS

Возвращает количество лет между двумя датами.

Syntax

YEARS(Начальная дата; Конечная дата; Тип)

Начальная дата является первой датой.

Конечная дата является второй датой.

Тип вычисляет тип различия. Возможные значения - 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

Надстройки для интерфейса программирования LibreOffice

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