# IF Weekday?

Hi,

I need to apply an if formula, that is sensitive to the weekday of a certain event.

So, my ideia was to have =Weekday(A5,1) wich in my case gives me the exact weekday of the date on cell A5, and then apply an IF formula that would see if the result is a specific value...Monday or whatever.

The problem is that I always get a NAME error in the IF formula... =IF(S5="monday",Y,N) for example...S5 being the cell with the previous formula. I also tried with =IF(S5=monday,Y,N).... Tried changing the format of S5 to Numbers which would give me 1 , and change the formula accordingly, but nothing...

My guess is that even though we might see monday or 1 in cell S5, Excel sees something else, that is why my IF formula does not work I guess.

Any ideias?
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Try this:

=IF(S5="monday","Y","N")

You missed " off the Y and N.

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Mechanical EngineerCommented:
Hi Menshen,
The WEEKDAY function returns a number 1 through 7. As you wrote your formula, the first day of the week is Sunday. If you want Monday to be the first day of the week, then you should use:
=WEEKDAY(A5,2)

If you want to test whether the date in A5 is a Monday, then try either of:
=WEEKAY(A5,2)=1                Returns TRUE if A5 is Monday. Returns FALSE otherwise
=IF(WEEKDAY(A5,2)=1, value if true, value if false)

Cheers!

Author Commented:
Janson,

That was one of my best "DOHHHH" moments :)

Thanks.