Retorna el dia de la setmana per al valor de data determinat. El dia es retorna com un nombre enter entre 1 (diumenge) i 7 (dissabte) si no s'indica cap tipus, o si s'indica tipus=1. Per a altres tipus, vegeu la taula següent.


DIASETMANA(Nombre; Tipus)

Nombre, com a valor de data, és un decimal per al qual es retornarà el dia de la setmana.

Type is optional and determines the type of calculation.


Weekday number returned

1 o omés

Entre 1 (diumenge) i 7 (dissabte). Per a compatibilitat amb el Microsoft Excel.


Entre 1 (dilluns) i 7 (diumenge).


Entre 0 (dilluns) i 6 (diumenge)


Entre 1 (dilluns) i 7 (diumenge).


Entre 1 (dimarts) i 7 (dilluns).


Entre 1 (dimecres) i 7 (dimarts).


Entre 1 (dijous) i 7 (dimecres).


Entre 1 (divendres) i 7 (dijous).


Entre 1 (dissabte) i 7 (divendres).


Entre 1 (diumenge) i 7 (dissabte).

Icona de nota

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


When entering dates as part of formulas, slashes or dashes used as date separators are interpreted as arithmetic operators. Therefore, dates entered in this format are not recognized as dates and result in erroneous calculations. To keep dates from being interpreted as parts of formulas use the DATE function, for example, DATE(1954;7;20), or place the date in quotation marks and use the ISO 8601 notation, for example, "1954-07-20". Avoid using locale dependent date formats such as "07/20/54", the calculation may produce errors if the document is loaded under different locale settings.


Unambiguous conversion is possible for ISO 8601 dates and times in their extended formats with separators. If a #VALUE! error occurs, then unselect Generate #VALUE! error in - LibreOffice Calc - Formula, button Details... in section "Detailed Calculation Settings", Conversion from text to number list box.


=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.

Icona de consell

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")

Please support us!