IF and Date

D

das

Hey crew, I'm a little rusty and need some refresher...

In column A I have the dates in =Date(yyyy,mm,dd) format

In column B, I am want the cells to say "OFF" if the day is equal to
Sunday or Monday for instance.

Right now I'm using this formula for Sunday:

=IF(DAY(7)=A4,"OFF","")

Which isn't working. I just can't remember the exact way to do it.

Thanks for your help.
 
J

Jacob Skaria

Try
=IF(TEXT(A1,"ddd")="Sun","Sunday","Not a Sunday")
OR
=IF(WEEKDAY(A1)=1,"Sunday","")

If this post helps click Yes
 
T

T. Valko

say "OFF" if the day is equal to Sunday or Monday

Try this:

=IF(WEEKDAY(A1)<3,"Off","")
 
D

das

Thanks Jacob,

It was the Weekday function that I was having trouble with. I simply for
got to identify the cell in question.
 
D

das

Well, what I've figured out is that Friday and Monday are the days that will
say "OFF"

Im using Jacobs passed on suggestion like this:

=IF(WEEKDAY(A8)=2,"OFF","")

But what I need is it to do the same if the day is 6 as well...

Something like this:

=IF(WEEKDAY(A8)=2)or(Weekday(A8)=6),"OFF","")

But this isn't working

Any ideas Valko?
 
D

das

Disregard last message. I messed around and figured it out with this:

=IF(OR(WEEKDAY(A5)=2,WEEKDAY(A5)=6),"OFF","")

Thanks everyone for you help
 
T

T. Valko

=IF(OR(WEEKDAY(A5)=2,WEEKDAY(A5)=6),"OFF","")

Try it like this:

=IF(OR(WEEKDAY(A5)={2,6}),"Off","")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top