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
Guilherme Eduardo de FariasGuilherme Eduardo de Farias 

Take the percentage between two fields.

I  need to get the percentage of completion between the StartDate and EndDate fields. I need him to see when the project is completed based on these dates.

I was using the following rule: 
(( TODAY ()   - Start_Date__c) / (End_Date__c - Start_Date__c)) * 100

But the result of the date 03/16/2020 to 04/20/2020
Best Answer chosen by Guilherme Eduardo de Farias
VinayVinay (Salesforce Developers) 
Hi Guilherme,

Try below

IF(
StartDate > TODAY() ,0,IF(FinishDate<TODAY(),100, ((TODAY()-StartDate)/(FinishDate-StartDate) )
)
)

Please mark as Best Answer if it was helpful.

Thanks,
Vinay Kumar

All Answers

VinayVinay (Salesforce Developers) 
Hi Guilherme,

Please try below snippet.

IF(
StartDate > TODAY() ,0,IF(FinishDate<TODAY(),100, (TODAY()-StartDate/(FinishDate-StartDate)*100 )
)

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
 
Guilherme Eduardo de FariasGuilherme Eduardo de Farias
Gave the following error

User-added image
VinayVinay (Salesforce Developers) 
Hi Guilherme,

Try below

IF(
StartDate > TODAY() ,0,IF(FinishDate<TODAY(),100, ((TODAY()-StartDate)/(FinishDate-StartDate) )
)
)

Please mark as Best Answer if it was helpful.

Thanks,
Vinay Kumar
This was selected as the best answer