Funções add-in

Segue-se uma descrição e lista de algumas das funções add-in disponíveis.

Conceito de Add-in

Encontrará a descrição da interface de Add-in do LibreOffice Calc na ajuda. São também descritas funções importantes e os respetivos parâmetros na ajuda da .

Extras disponibilizados

O LibreOffice contém exemplos para a interface de add-in do LibreOffice Calc.

Funções de Análise - Parte Um

Funções de Análise - Parte Dois

DAYSINMONTH

Calcula o número de dias do mês em que ocorre a data introduzida.

Sintaxe

DIASNOMÊS(data)

data é qualquer data no respetivo mês do ano pretendido. O parâmetro data terá de corresponder a uma data válida de acordo com as definições de configuração regional do LibreOffice.

Exemplo

=DIASNOMÊS(A1) devolve 29 dias se A1 contiver 1968-02-17, uma data válida para fevereiro de 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

tip

DAYSINYEAR

Calcula o número de dias do ano em que ocorre a data introduzida.

Sintaxe

DIASNOANO(data)

data corresponde a qualquer data no respetivo ano. O parâmetro data terá de corresponder a uma data válida de acordo com as definições de configuração regional do LibreOffice.

Exemplo

=DIASNOANO(A1) devolve 366 dias se A1 contiver 1968-02-29, uma data válida para o ano 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

tip

ISLEAPYEAR

Determina se um ano é bissexto. Se for bissexto, a função devolve o valor 1 (VERDADEIRO); se não for, devolve o valor 0 (FALSO).

Sintaxe

ANOBISSEXTO(data)

data é qualquer um dos dias do ano desejado. O parâmetro data tem que ser uma data válida.

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.


Exemplo

=ANOBISSEXTO(A1) devolve 1, se A1 contiver 1968-02-29, o formato de data válido 29 de fevereiro de 1968 na definição de configuração regional.

Também pode utilizar =ANOBISSEXTO(DATA(1968;2;29)) ou =ANOBISSEXTO("1968-02-29"), sendo que a cadeia de carateres da data tem que estar no formato ISO8601.

Nunca utilize =ANOBISSEXTO(2/29/68), uma vez que iria primeiro avaliar 2 dividido por 29 dividido por 68 e, em seguida, calcular a função ANOBISSEXTO a partir deste pequeno número como um número de data em série.

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

Calcula a diferença entre duas datas, em meses.

Sintaxe

MESES(data_inicial; data_final; tipo)

data_inicial é o primeiro dia do período

data_final é o último dia do período

tipo determina o tipo de cálculo. Os valores possíveis são 0 (intervalo) e 1 (anos de calendário).

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

Cifra uma cadeia de caracteres movendo os caracteres 13 posições no alfabeto. Após a letra Z, o alfabeto recomeça (Rotação). Se pretender decifrar o texto, basta aplicar nova função de cifra.

Sintaxe

ROT13(texto)

texto é a cadeia de caracteres a ser cifrada. ROT13(ROT13(texto)) decifra o código.

Exemplo

=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

Calcula a diferença em semanas entre duas datas.

Sintaxe

SEMANAS(data_inicial; data_final; tipo)

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.


Exemplo

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

Calcula o número de semanas do ano no qual a data introduzida ocorre. O número de semanas é definido da seguinte forma: uma semana que abrange dois anos é considerada parte do ano que inclui mais dias dessa mesma semana.

Sintaxe

SEMANASNOANO(data)

data é qualquer data no respetivo ano. O parâmetro data terá de corresponder a uma data válida de acordo com as definições de configuração regional do LibreOffice.

Exemplo

SEMANASNOANO(A1) devolve 53 se A1 contiver 1970-02-17, uma data válida para o ano 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

tip

YEARS

Calcula a diferença em anos entre duas datas.

Sintaxe

ANOS(data_inicial; data_final; tipo)

data_inicial é o primeiro dia do período

data_final é o último dia do período

tipo determina o tipo de cálculo. Os valores possíveis são 0 (intervalo) e 1 (anos de calendário).

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

Suplementos com a API do LibreOffice

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

Necessitamos da sua ajuda!