having trouble with nested IF function

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"
}
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi, mwooster

The way you use operators in formulas are wrong.

=IF(AND(A1 = "Hi", B1 = "mwooster"), True, False)

Unlike VBA, you must put AND or OR in front first and state the conditions delimited by commas.
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

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