mwooster21
New Member
- Joined
- Jul 7, 2011
- Messages
- 10
I am trying to nest boolean expressions in an IF function but I am having trouble getting it working. Can anyone help me figure out how the syntax is supposed to go?
Here is a image of just part of my spreadsheet (it wouldnt paste into the message). The rows are J,K,L,M,N
http://imageshack.us/photo/my-images/560/nestifboolean.jpg/
Here is a variation of what I have been trying but i get an error:
=IF((K2=7 and(L2=J2)), (or(K2=7) and(L2-J2=1)), (or(K2=1) and(L2=J2)), "Weekend", "Week")
What I need is to identify jobs that started and ended on the same weekend. Saturday, Sunday, Saturday-Sunday.
In pseudo code it would be something likes this:
If
{
start day = Saturday and start date = end date
{or start day = Saturday and end date-start date = 1}
{or start day = Sunday and start date = end date}
"Weekend"
}
Here is a image of just part of my spreadsheet (it wouldnt paste into the message). The rows are J,K,L,M,N
http://imageshack.us/photo/my-images/560/nestifboolean.jpg/
Here is a variation of what I have been trying but i get an error:
=IF((K2=7 and(L2=J2)), (or(K2=7) and(L2-J2=1)), (or(K2=1) and(L2=J2)), "Weekend", "Week")
What I need is to identify jobs that started and ended on the same weekend. Saturday, Sunday, Saturday-Sunday.
In pseudo code it would be something likes this:
If
{
start day = Saturday and start date = end date
{or start day = Saturday and end date-start date = 1}
{or start day = Sunday and start date = end date}
"Weekend"
}