Día da semana

Contido

# WEEKDAY

Returns the day of the week for the given date value. The day is returned as an integer between 1 (Sunday) and 7 (Saturday) if no type or type=1 is specified. For other types, see the table below.

### Sintaxe

WEEKDAY(Number [; Type])

Number, as a date value, is a decimal for which the weekday is to be returned.

Type is optional and determines the type of calculation.

Tipo | Weekday number returned
--- | ---
1 or omitted | 1 (Sunday) through 7 (Saturday). For compatibility with Microsoft Excel.
2 | 1 (Monday) through 7 (Sunday).
3 | 0 (Monday) through 6 (Sunday)
11 | 1 (Monday) through 7 (Sunday).
12 | 1 (Tuesday) through 7 (Monday).
13 | 1 (Wednesday) through 7 (Tuesday).
14 | 1 (Thursday) through 7 (Wednesday).
15 | 1 (Friday) through 7 (Thursday).
16 | 1 (Saturday) through 7 (Friday).
17 | 1 (Sunday) through 7 (Saturday).

These values apply only to the standard date format that you select under LibreOffice - PreferencesTools - Options- LibreOffice Calc - Calculate.

Ao inserir datas como partes de fórmulas, as barras ou guións empregados como separadores de datas interprétanse como operadores aritméticos. Polo tanto, as datas introducidas neste formato non se recoñecen como datas e producen cálculos erróneos. Para que as datas sexan interpretadas como parte das fórmulas hai que empregar a función DATA, por exemplo, DATA(1954;7;20) ou colocar a data entre aspas e empregar a notación ISO 8601, por exemplo, «1954-07-20». Evite empregar formatos de data dependentes de formatos rexionais, como «07/20/54» porque o cálculo pode producir erros se o documento se carga cunha configuración local diferente.

É posíbel unha conversión sen ambigüidades para as datas e horas en ISO 8601 nos seus formatos estendidos con separadores. Se se produce un erro #VALUE!, desmarque Xerar erro #VALUE! en LibreOffice - PreferenciasFerramentas - Opcións - Calc do LibreOffice - Fórmula, botón Detalles... na sección «Configuración detallada para cálculos», na caixa de lista Conversión de texto en número.

### Exemplos

=WEEKDAY("2000-06-14") returns 4 (the Type parameter is missing, therefore the standard count is used. The standard count starts with Sunday as day number 1. June 14, 2000 was a Wednesday and therefore day number 4).

=WEEKDAY("1996-07-24";2) returns 3 (the Type parameter is 2, therefore Monday is day number 1. July 24, 1996 was a Wednesday and therefore day number 3).

=WEEKDAY("1996-07-24";1) returns 4 (the Type parameter is 1, therefore Sunday is day number 1. July 24, 1996 was a Wednesday and therefore day number 4).

=WEEKDAY("2017-05-02";14) returns 6 (the Type parameter is 14, therefore Thursday is day number 1. May 2, 2017 was a Tuesday and therefore day number 6)

=WEEKDAY(NOW()) returns the number of the current day.

To obtain a function indicating whether a day in A1 is a business day, use the IF and WEEKDAY functions as follows:
IF(WEEKDAY(A1;2)<6;"Business day";"Weekend")

#### Información técnica

Esta función é parte da norma Formato Open Document para Aplicacións de Ofimática (OpenDocument), versión 1.2 (ISO/IEC 26300:2-2015)

Temas relacionados

WEEKDAY wiki page.

Funcións de data e hora

DATA

DATEDIF

DATEVALUE

Día

días

días360

DÍASPORMES

DÍASPORANO

DOMINGOPASCUA

DATAM

FINMES

Hora

ÉANOBISESTO

NUMSEMANAISO

Minuto

Mes

MESES

NETWORKDAYS

NETWORKDAYS.INTL

AGORA

Segunda

Hora

TIMEVALUE

HOXE

WEEKDAY

NUMSEMANA

NUMSEMANA_EXCEL2003

NUMSEMANA_OOO

SEMANAS

SEMANASPORANO

DÍAÚTIL

WORKDAY.INTL

Ano

FRACCIÓNANO

ANOS

Precisamos da súa axuda!