Weekday shows the wrong day

GK039

Board Regular
Joined
Oct 29, 2010
Messages
220
Hello everybody,

Back again after sooo long

I am facing a problem with the weekday function that after a bit of googling I saw that is a common question but I couldn't find an answer.

Say in cell A1 there is the date 10-01-2019 which is a Thursday
Code:
=weekday(A1,1) gives a 5 (correct). Applying custom formatting "dddd" is a Thursday (correct)

but

Code:
=weekday(A1,2) gives a 4 (correct). Applying custom formatting "dddd" is a Wednesday (false)

Could you explain me the logic behind this behavior and how to overcome this?

PS: I changed at the region settings the "First Day of week" text box to be a Monday but still doesn't work

Thank you!
George
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Weekday doesn't return a date, so I don't quite get why you are formatting it as a date format (dddd)

The logic is dates are just numerical sequences starting from Jan 1, 1900. So 5 would be January 5, 1900 Thursday, while 4 would be Janary 4, 1900 Wednesday.

So the question is what are you trying to accomplish exactly?
 
Last edited:
Upvote 0
Weekday doesn't return a date, so I don't quite get why you are formatting it as a date format (dddd)

The logic is dates are just numerical sequences starting from Jan 1, 1900. So 5 would be January 5, 1900 Thursday, while 4 would be Janary 4, 1900 Wednesday.

So the question is what are you trying to accomplish exactly?

Hello Scott,

Thank you for your answer. As far as the logic part is concerned its clear now, thanks.
What I am trying to accomplish is to get the weekday out of a date and show the day in text format, which also the

Code:
 =TEXT(WEEKDAY(A1,2),"dddd")

doesn't seem to do it.

George
 
Upvote 0
Hello Scott,

Thank you for your answer. As far as the logic part is concerned its clear now, thanks.
What I am trying to accomplish is to get the weekday out of a date and show the day in text format, which also the

Code:
 =TEXT(WEEKDAY(A1,2),"dddd")

doesn't seem to do it.
You do not need to use the WEEKDAY function as the TEXT function can work with dates directly. Try it this way...

=TEXT(A1,"dddd")
 
Upvote 0
You do not need to use the WEEKDAY function as the TEXT function can work with dates directly. Try it this way...

=TEXT(A1,"dddd")

Thank you Rick. I thought the TEXT function could work in conjunction with the WEEKDAY function as well.
It's clear now.
George
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,923
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top