How do I get the day name into a cell in Excel?

Given a date, how do I get the day of the week (e.g. "Monday") into a cell in Excel?


Solution 1:

Simple example:

A1 cell: 1/8/2009
B1 cell: =TEXT(WEEKDAY(A1),"dddd")

This will, for the given date, print the corresponding day.

Is this what you wished ?

Solution 2:

The answer given above is only working by fluke because Excel thinks that 1/1/1900 was a Sunday* and by default Excel is using Sunday as first day of week for the Weekday function.

What you are actually calculating in that method is the day of the week as a number, then formatting that as a day based on that number interpreted as a date. Eg if your date is 1/2/2003 and you use the WEEKDAY function, this results in 7 (=Saturday). When you then format this as "dddd" you are actually getting the day name of the 7th day in Excel since its "epoch", ie 7/1/1900, which happens to be a Saturday*. This formula will break if someone opens it who has the option selected to use the 1904-based date system, as 1/1/1904 was not a Sunday, but a Friday. (yes I know hardly anyone uses that, but you don't want to build a solution which relies on that do you?)

You can make the formula shorter, faster and more robust simply by using

=TEXT(A1,"dddd")

You could of course just format the date cells themselves with a custom format as already suggested, depending on whether you really need this in a separate column or not. I often use date formats such as

ddd dd mmm yyyy

to give eg Sat 01 Feb 2003 so the date is explicit but shows the weekday name as well.

Using a second column and a TEXT function is essential if you want to use the weekday explicitly somewhere in a mail merge (for example), similarly for things like currencies and so on Excel > Word merging passes the actual underlying stored value rather than the on-screen formatted version, so regardless of the cell format, Word sees some horrible number. A true text field is passed 'as is' and displays properly in Word.

*in fact it is a Monday but Excel was written to match the incorrect dates in Lotus 1-2-3 which treated 1900 as a leap year when it is not.

Solution 3:

Another possibility, depending on what you want to do with the date afterwards, is to set the cell's format to Custom: dddd

Solution 4:

I found that nesting IF statements can be cumbersome, but it does work. If, however, you'd like to save a little typing, you may try this:

=CHOOSE(WEEKDAY(A2), "Sun","Mon","Tue","Wed","Thur","Fri","Sat")

Or, if you need full names:

=CHOOSE(WEEKDAY(A2), "Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

In this example, "A2" can be whatever cell (or formula) contains the date in question. For instance:

=CHOOSE(WEEKDAY(TODAY()), "Sun","Mon","Tue","Wed","Thur","Fri","Sat") 

would print the three letter abbreviation for whatever today is.

Solution 5:

you can also localize the answer by using [$nnn] before the format (so the custom code is: [$nnn]dddd;@). change nnn with the proper language code. i don't have the list, but somehow, english code is -409 (and my local is -421).

i think you can experiment with Number format, change the language field, then change it back to custom format.