I’m making a table with dates in one column and weekdays in another in LibreOffice Calc. The column $A
has dates formatted as YYYY-MM-DD, the column $B
has weekdays derived from these dates using WEEKDAY
formula and is formatted as NN (shortened weekday name).
Now, I have locale set to Russian and our week starts on Monday. The issue is that while the displayed weekday name matches the actual weekday of the corresponding date, the weekday cell VALUE
is off by 1 for my locale (i.e. Friday has value of 6 instead of 5).
According to documentation for WEEKDAY
function (WEEKDAY), it has the following syntax: WEEKDAY(Number; Type). The default type is 1 and the default returned values start from 1 for Sunday, 2 for Monday etc. But I can override this by setting type parameter to 2
, so Monday becomes the first day of the week. And that’s where strange things start to happen.
For the cell $A2
set to 2019-11-01
(which is Friday), the cell $B2
results in the following:
If the formula is =WEEKDAY($A2)
, the displayed weekday is Friday
(correct), but the cell VALUE is 6
(incorrect).
If the formula is =WEEKDAY($A2;2)
, the cell VALUE
becomes 5
(correct), but the displayed weekday becomes Thursday` which is wrong!
What am I doing wrong? Or what settings should I change to get weekday number and weekday name in sync according to my locale? I was under impression that this should be happening automatically, but, apparently, it doesn’t.