IF Weekday?


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.

Try this:


You missed " off the Y and N.

Experts Exchange Solution brought to you by

Your issues matter to us.

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

Start your 7-day free trial
byundtMechanical 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:

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)


MenshenAuthor Commented:

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



I have a different regional setting, I guess that is why my previous settings work for me.  

No problem at all mate. Thanks for the points and grade :)

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.