How to stop counting days when using DATEIF Funtion to Count days between two dates

Marcie Be

Board Regular
Joined
Jun 25, 2020
Messages
124
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I was originally just counting the numbers of days between two dates. An earlier date and today.
The below formula did this for me
T4==IF($S4="","",DATEDIF($S4,IF($U5>=0,TODAY()),"D"))

Now in $U5 when I enter a completion date, I want the count in cell T4 to stop as the task is completed.
How does my formula above need to be modified to stop counting?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try either of the following

T202007a.xlsm
STU
3
431-Dec-1991
531-Mar-20
631-Dec-1991
731-Mar-20
8
1b
Cell Formulas
RangeFormula
T4T4=IF($S4="","",DATEDIF($S4,MIN($U5,TODAY()),"D"))
T6T6=(S6>0)*MIN($U7,TODAY())-S6
 
Upvote 0
Try either of the following

T202007a.xlsm
STU
3
431-Dec-1991
531-Mar-20
631-Dec-1991
731-Mar-20
8
1b
Cell Formulas
RangeFormula
T4T4=IF($S4="","",DATEDIF($S4,MIN($U5,TODAY()),"D"))
T6T6=(S6>0)*MIN($U7,TODAY())-S6

Thank you Dave

I have made the modification, I will confirm tomorrow that the count has stop as of the completion date.
Can I ask, how the replacement of IF with MIN and the removal of $U5>=0, wil stop the count once a completion date is entered into $U5?
I like to understand the logic and learn
 
Upvote 0
Try either of the following

T202007a.xlsm
STU
3
431-Dec-1991
531-Mar-20
631-Dec-1991
731-Mar-20
8
1b
Cell Formulas
RangeFormula
T4T4=IF($S4="","",DATEDIF($S4,MIN($U5,TODAY()),"D"))
T6T6=(S6>0)*MIN($U7,TODAY())-S6

@Dave Patton, I have confirmed the revised formula below works. I had dates in the cells S4 and U5 and S4 was still counting using todays's date. That has stopped now uing the new formula and counted only up until the completion date was entered.

T4=IF($S4="","",DATEDIF($S4,MIN($U5,TODAY()),"D"))

Thanks again, much appreciated

Best Regards

Marcie Be
 
Upvote 0
Thanks for the feedback.
T202007a.xlsm
STU
44383091
543921
6
1b
Cell Formulas
RangeFormula
T4T4=(Start>0)*(MIN(Completion,TODAY())-S4)
Named Ranges
NameRefers ToCells
Completion='1b'!$U$5T4
Start='1b'!$S$4T4



T202007a.xlsm
STUVWXYZAA
7T4=IF(Start="","",DATEDIF(Start,MIN($U5,TODAY()),"D"))
8T4=(Start>0)*MIN(Completion,TODAY())-S4
9
10This post shows the Dates in General format; the format doesn't affect calculations.
11It is often useful to review formulas with Excel's Formulas Evaluate Formula
12True = 1 False = 0
13Start 43830>0 True
14Min of Completion 43921 and Today 44018 is 43921 therefore
1543921-43830 =91
1b
 
Upvote 0

Forum statistics

Threads
1,214,962
Messages
6,122,482
Members
449,088
Latest member
Melvetica

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