Irfan
Irfan

Reputation: 2771

How to Compare date formated as day with some day?

In one of the excel cell is the date (say 01.11.2013). I have formated this cell as DDDD so it is displayed as day (for this date it is Friday).

Now I am not able to compare the contents of the cell (actually being displayed as Friday) with string "Friday".

Is it possible? I have used Value(Text) formula and Exact(text, text) formula but it does not helps.

Thanks in advance.

Upvotes: 0

Views: 70

Answers (2)

barry houdini
barry houdini

Reputation: 46341

TEXT function varies by region - you need to use the equivalent of "dddd" for your region....or use WEEKDAY function which doesn't vary

=IF(WEEKDAY(A1)=6,"yes","no")

WEEKDAY returns 1 for Sunday through to 7 for Saturday

Upvotes: 2

Huy Pham
Huy Pham

Reputation: 493

Use TEXT function to compare. For example:

=IF(TEXT(A1,"DDDD")="Friday","Equal","Not")

to compare cell A1 with "Friday"

Upvotes: 3

Related Questions