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
nicklsnickls 

Formula for returning Days since Last Activity?

Hi All,

 

This is probably a really noob question, but I'm just getting my head around things.

 

I have created a formula field called DaysSinceLastActivity, which does this:

 

ROUND(TODAY()-LastActivityDate, 0)

 

This returns an integer number for days between today and the LastActivityDate. 

 

The problem I am having is that if my guys put in reminders - activities to contact a lead at a particular point in the future, my "DaysSince" field starts returning a negative number: it subtracts (Activity Due Date) from (Today). 

 

Is there a way to get this formula to ignore future dates altogether, and roll with LastActivityDate's that are in the past only? 

 

I thought about having it return 0 if the number is negative, but that is basically wrong too.

 

Ideas?

 

Thanks in advance!

Nick

HelpWanted.ax730HelpWanted.ax730

Nick,

 

I had a similar issue, but I went the route of having the formula display 0. At the end of the day, I am looking for any lead that hasn't had any activity logged against it, during the last 30 days. Not sure if this option will work for you, but here is the formula I used.

 

max(IF(NOT(ISNULL(LastActivityDate)),TODAY() - LastActivityDate,NOW()- CreatedDate ),0) 

 

-Bermy

nicklsnickls

Thanks a lot Bermy, it probably does make more sense to have that 0 as a ceiling (or floor?) for the value. Annoying though the formula cant be written to ignore future dates though. Sigh.

jboltzejboltze

Is there a way to inclue the current date in the code? It doesn't seem to work on activities created today.