ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF and Date (https://www.excelbanter.com/excel-worksheet-functions/239135-if-date.html)

DAS

IF and Date
 
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.

Jacob Skaria

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

If this post helps click Yes
---------------
Jacob Skaria


"das" wrote:

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.


T. Valko

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

Try this:

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

--
Biff
Microsoft Excel MVP


"das" wrote in message
...
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.




DAS

IF and Date
 
Thanks Jacob,

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


"Jacob Skaria" wrote:

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

If this post helps click Yes
---------------
Jacob Skaria


"das" wrote:

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.


DAS

IF and Date
 
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?




DAS

IF and Date
 

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. Valko

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

Try it like this:

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

--
Biff
Microsoft Excel MVP


"das" wrote in message
...

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





All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com