function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Glenn Soden 2Glenn Soden 2 

Rolling Day Count Calculation until Future Date Entry

Trying to figure out how to count number of days and populate a field for "Date__C" calcualtion.  That part is easy.  But need it to count until ANOTHER date is entered then stop.

Assuming a workflow rule that can run the "counter" but then how to stop once second date is entered and be calculated upon.

(Date1__C) - TODAY()  - this runs and gives a running count  (X # of Days in number field) until below happens  

(Date1__C) - (Date2__D) which then produces (X # of Days in number field) and stops as the final date has been entered and reached.

Any ideas? And no not going ot get into the weekend days vs week days.  Thanks in advance!! 
Best Answer chosen by Glenn Soden 2
RD@SFRD@SF
Hello Glen,

I think this can be achieved by a number formula field itself. 
Solution:-
We have two dates
1) Date1__c
2) Date2__c

The formula field
IF(ISBLANK(DATE1__c),0,IF(ISBLANK(DATE2__c),TODAY()-DATE1__c,DATE2__c-DATE1__c))

Hope it helps.
RD 

 

All Answers

RD@SFRD@SF
Hello Glen,

I think this can be achieved by a number formula field itself. 
Solution:-
We have two dates
1) Date1__c
2) Date2__c

The formula field
IF(ISBLANK(DATE1__c),0,IF(ISBLANK(DATE2__c),TODAY()-DATE1__c,DATE2__c-DATE1__c))

Hope it helps.
RD 

 
This was selected as the best answer
Glenn Soden 2Glenn Soden 2

Yup RD - thats what I ended up doing.  here is what eneded up working for me below

Data TypeFormula  
Decimal Places0  
IF(ISBLANK(Submitted__c ),TODAY() - Opportunity__r.CloseDate, Submitted__c - Opportunity__r.CloseDate)