difference between two dates with condition

reymon2012

New Member
Joined
Feb 3, 2012
Messages
17
Hello..i need your assistance.

i have two date columns in excel, 1st i need to get the difference between those dates, and based on the result i have additional condition.
if the difference is >=5 days prior to closing date the result needs to be 1, otherwise its 0 if completed inside 5 days prior to closing date.

Attached sample as reference. Any help much appreciated.
 

Attachments

  • sample1.png
    sample1.png
    8.9 KB · Views: 7

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Please check your criteria.
Consider

T202401a.xlsm
ABCDE
1
2ClosingCompletedResult Result b0 Within 5
306-12-2301-12-23110
410-12-2301-12-23111
503-12-2301-12-23000
6
1d
Cell Formulas
RangeFormula
C3:C5C3=--(ABS(B3-A3)>=5)
D3:D5D3=--(AND((B3-A3)<0,ABS(B3-A3)>=5))
E3:E5E3=--(AND((B3-A3)<0,ABS(B3-A3)>5))
 
Upvote 0
Book3
ABCD
2clos ing date Task Complete DateDiffResult
312/6/202312/1/202351
412/10/202312/1/202391
512/3/202312/1/202320
Sheet1
Cell Formulas
RangeFormula
C3:C5C3=A3-B3
D3:D5D3=IF(C3>=5,1,0)
 
Upvote 0
Book3
ABCD
2clos ing date Task Complete DateDiffResult
312/6/202312/1/202351
412/10/202312/1/202391
512/3/202312/1/202320
Sheet1
Cell Formulas
RangeFormula
C3:C5C3=A3-B3
D3:D5D3=IF(C3>=5,1,0)
It works. and i also reversed your formula; the result is 1 if transaction is completed within days of the closing date.
However , i need to add another 2nd criteria based on the result of the 1st criteria.

IF Start date is within 5 days of the closing date, task needs to be completed within 1 business days from start date..

Can we combine both formula?
 

Attachments

  • Sample 2 .jpg
    Sample 2 .jpg
    16.8 KB · Views: 3
Upvote 0
This is a guess. Please explain clearly your requirement and post an example with expected results.
Try either or both of the suggestions.

T202401a.xlsm
ABCDE
725-Dec-2301-Dec-232400
820-Dec-2301-Dec-231900
905-Dec-2303-Dec-23211
10
1d
Cell Formulas
RangeFormula
C7:C9C7=A7-B7
D7:D9D7=--(C7<5)
E7:E9E7=--(A3-B3<5)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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