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
Jason L.ax300Jason L.ax300 

Formula for calculating days to convert a lead - solution

I searched the board here and couldn't find a solution but ended up coming up with one myself.  We needed to know what our average time was (in days) to convert a lead.    Since our CreateDate for leads was a DATE field and our ConvertedDate was a DATETIME field, doing a simple  {converteddate} - {createddate} wouldn't work.
 
Anyway, here's the formula I used, hopefully it's useful to others...
 
(DATE(YEAR(ConvertedDate ),MONTH(ConvertedDate ),DAY(ConvertedDate ))) - (DATE(YEAR( DATEVALUE(CreatedDate) ),MONTH(DATEVALUE(CreatedDate) ),DAY(DATEVALUE(CreatedDate) )))
Harry JamesHarry James

Couldn't this be simplified to:

IF (ISNULL ( ConvertedDate ), null,
ConvertedDate - DATEVALUE(CreatedDate) )

 

Jason L.ax300Jason L.ax300
even better...thanks!