Adding a New Condition to an IF Statement

maic15

Active Member
Joined
Nov 17, 2004
Messages
313
I have the following IF Statement:
Formula in C2 is:
=IF(($A2>=DATEVALUE(LEFT($C2,FIND(" ",$C2)-1)))*($B2<=DATEVALUE(MID($C2,FIND("-",$C2)+2,LEN($C2)))),1,0)

I need to ad logic to reflect the new condtion below..Not sure how to do it..
Book1
ABCDE
11Start DateEnd DateWeek
2210/31/200511/4/200510/31/05 - 11/4/051
3310/29/200511/4/200510/31/05 - 11/4/050
4411/1/200511/4/200510/31/05 - 11/4/051
5
6Add New Condition
7510/31/200511/15/200510/31/05 - 11/4/051
8610/21/200511/17/200510/31/05 - 11/4/051
Sheet1
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
You have not specified what how you want the new condition to be reflected. Are you looking to report on items between certain dates?

You could use and AND or OR formula:
=if(and(condtion1,condition2),true,false)

or perhaps another formula is better.

Tell us what your formula is supposed to do.
 
Upvote 0
I need to add to the condtion if Start Date >= Week and End Date >= Week, then return 1. See condtion.

=IF(($A2>=DATEVALUE(LEFT($C2,FIND(" ",$C2)-1)))*($B2<=DATEVALUE(MID($C2,FIND("-",$C2)+2,LEN($C2)))),1,0)
 
Upvote 0
Try:
=IF(AND(A2>=VALUE(LEFT(C2,SEARCH("-",C2)-1)),B2>=VALUE(RIGHT(C2,LEN(C2)-SEARCH("-",C2)-1))),1,0)

assumes consistent spacing between dates.

[EDIT]: I am not sure I would call 12 days "Week". Perhaps cells C1 should read "period"
 
Upvote 0
One problem...If Start Date is greater than Left(Week) then return should be 0

SD = 11/5/05 and ED = 11/15/05, then 0
 
Upvote 0

Forum statistics

Threads
1,211,686
Messages
6,103,297
Members
447,853
Latest member
olddutch7

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