Link to home
Start Free TrialLog in
Avatar of Menshen
Menshen

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of JasonH2005
JasonH2005

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of byundt
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!

Brad
Avatar of Menshen
Menshen

ASKER

Janson,

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

Thanks.

Brad,

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

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

JasonH