user2597012
user2597012

Reputation: 647

Excel get Day Name gives an Error

So I have been stuck at this weird error with excel 2010. I have the following data at cell A4 which is a reference to another cell B1, which is a start date entered by user, and I am trying to get day name by using the formula =CHOOSE(WEEKDAY(B4),"Su","Mo","Tu","We","Th","Fr","Sa"), yet it gives an error with no real clues. Also I have tried

=Text(B4, "dddd")

and it gives an error as well.

enter image description here

Any ideas?

Upvotes: 2

Views: 403

Answers (2)

Egan Wolf
Egan Wolf

Reputation: 3573

The issue is that, depending on regional settings, you should use semicolon ; instead of comma , as separator in formulas.

Upvotes: 1

Koby Douek
Koby Douek

Reputation: 16693

I have encountered the same error myself. The problem is not in the CHOOSE function, but in the WEEKDAY function.

It turns out that the WEEKDAY function is expecting very strict date formats and is influenced by the system's date format.

As stated in the cell's date format panel:

NOTE: Date formats that begin with an asterisk (*) will change if you change the regional date and time settings in Control Panel. Formats without an asterisk won’t change.

The solution is to change the date cell's format to a strict date format, one of the formats in the list without a * symbol, and then entering a date in the format of 01-JAN-2018.

As you can see in the image below, this solved my problem:

enter image description here

Upvotes: 0

Related Questions