Date Formula

reymon2012

New Member
Joined
Feb 3, 2012
Messages
17
Good Evening All, In need of assistance for a date formula.

In cell A2 I have date value for Anticipated Complete Date (ACD), B2 date value for start date (SD) and C2 date value for Completed date (CD).
Based on the given value above I need a formula that will return a value on Cell D and E based on the following criteria.

Cell D = if difference between two dates for A2 and C2 is within 5 days before complete date it will return a value of “1” , otherwise value is “0”
Cell E = if difference between two dates for C2 and B2 is <=1 day it will return a value of “0”, otherwise “1”.

Any help is much appreciated.
 

Attachments

  • Sample.png
    Sample.png
    11.2 KB · Views: 11

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hello,

I assume you meant A2 and B2 "Cell D = if difference between two dates for A2 and C2" as C2 is the end date. I used B2; but you can change that. :)

Cell D1 =IF(DAYS(B2,A2)+DAYS(C2,B2)<=5,1,0)
Cell E1 =IF( DAYS(C2,B2)<=1,0,1)

Jamie
 
Upvote 0
Hello Gitmeto,

=if(A2-C2<5,1,0) A2-C2 will be a negative number.

And Excel gets a little bit messed up using dates, as the associated numbers, are seconds of a day.

:)

Jamie
 
Upvote 0
Maybe I have the order incorrect but I typed two dates in two different columns then applied the formula. Maybe try changing the data type to short date then you won't have to deal with the minutes, seconds, etc.
 
Upvote 0
Hello,

I assume you meant A2 and B2 "Cell D = if difference between two dates for A2 and C2" as C2 is the end date. I used B2; but you can change that. :)

Cell D1 =IF(DAYS(B2,A2)+DAYS(C2,B2)<=5,1,0)
Cell E1 =IF( DAYS(C2,B2)<=1,0,1)

Jamie
Appreciate the reply Jamie.

Regarding Cell D value. Its A2-C2 and NOT B2-C2.
 
Upvote 0

Forum statistics

Threads
1,215,497
Messages
6,125,160
Members
449,209
Latest member
BakerSteve

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