IF statement and WEEKDAY

thart21

Board Regular
Joined
Mar 3, 2005
Messages
159
I think I'm close but can't seem to get this one to work.

=IF((AND(E105<>"#",K105<E105)),"On Time",(IF((AND(K105-E105=3,WEEKDAY(K105=2),"On Time","Late")))

What I'm looking for:

(E and K are DATES)

IF E105 doesn't have a "#" AND K105 is less than E105, then it's "On Time" OR IF K105-E105=3 AND the WEEKDAY of K105 is a Monday(2), then it's "On Time", otherwise it's "Late".

It's just giving me the "formula contains an error" message but can't figure out where the problem is.

Thanks!

Toni
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
=IF(OR(AND(E105<>"#",K105<E105),AND(K105-N(E105)=3,WEEKDAY(K105)=2)),"On Time","Late")<E105),AND(K105-N(E105)=3,WEEKDAY(K105)=2)),"ON p Time?,?Late?)<>
 
Last edited:
Upvote 0
Try this.

Undested:

=IF(AND(E105<>"#",K105<E105),"On Time",IF(AND(K105-E105=3,WEEKDAY(K105)=2),"On Time","Late"))

Provide some sample data if htat doens't work and I can refine it.
 
Upvote 0
The problem is the < you can put a space after it and it might help as this is the opening bracket for an HTML tag. Did my formula work for you?
 
Upvote 0
you can also use the html special character code

& lt ;

without the spaces. (lt = less than)
 
Upvote 0
I don't know what happened to my post, but most of my formula did not make it.

Here is the actual formula I was trying to write.

IF((AND(E105<>"#",K105 < E105)),"On Time",(IF((AND(K105-E105=3,WEEKDAY(K105=2),"On Time","Late")))

Thanks for the help, your solutions worked great! I'll need to learn about the "N(E103)" part, haven't seen that in my searches yet.

Toni
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,671
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top