Reputation: 5355
I am in London GMT Time Zone.
If I plug into my excel:
=IF(OR(WEEKDAY(F20)=6;WEEKDAY(F20)=7);TRUE;FALSE)
I get TRUE
back which is clearly wrong because it is a Friday
in my Time Zone!
However, this is wrong see here:
Why is this error is excel?
I appreciate your answer!!!
Upvotes: 2
Views: 6532
Reputation: 1502446
WEEKDAY(F20)
will be 6 - which is Friday.
From the documentation:
The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default.
So 6 is a Friday.
It looks like you should be checking whether WEEKDAY(F20)
is 1 or 7, if you're trying to find out if it's a weekend.
If you want to use Monday (1) - Sunday (7) you need to pass in a second value of 2 to the function:
WEEKDAY(F20, 2)
(Again, see the documentation.)
Upvotes: 10