Credit portal




How do i get dividends

how do i get dividends

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

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

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

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.

Category: Bank

Similar articles: