I have a Number field that I need to be able to change the value of based on => Today's date. Is this possible with formula fields?

Field 1 = Last_Month_For_Adjustment__c //this is a date field//
Field 2 = Previous_Month_Subscription_Count__c //this is a number field//
Field 3 = Present_Month_Subscription_Count__c //this is a number field//

Required Logic- If Last_Month_For_Adjustment__c is equal to or greater than today, then Previous_Month_Subscription_Count__c would display 0, otherwise it would display value in Present_Month_Subscription_Count__c

Here is the formula that I have tried:

    TODAY() <=  (Last_Month_For_Adj__c), 

3 Answers 3


Yes, it is possible. The only thing you need to ensure here is that all of the possible results are of the same type as the return type of your formula field (Number, in your case).

The only mistake that I see in your formula is that you put double quotes around 0, making it a string rather than a number.

Fix that, and the formula ought to work

    /* Just swapping around the arguments to make it more natural to read */
    /* Does not impact the evaluation of the formula */
    Last_Month_For_Adj__c >= TODAY(), 
    /* No quotes around the 0, you want this to be treated as a Number type */
  • Thank you for the response. This should impact only those records that have today's date, or some date in the future. I notice that a record dated for today did not update as expected. Perhaps something else needs to be tweaked?
    – Ron
    Sep 1, 2022 at 14:41
  • @Ron is Last_Month_For_Adj__c a Date, or a DateTime? If it is a DateTime then you may be able to get around that by simply extracting the Date component using DATE(Last_Month_For_Adj__c)
    – Derek F
    Sep 1, 2022 at 14:51
  • it s a date field.
    – Ron
    Sep 1, 2022 at 15:19
  • So, the second half of the solution presented above seems to work fine, where the value in the field get sets to Present_Month_Subscription_Count__c. However, the first part, where the value needs to be set to zero (0) if the date is anytime in the future isn't. I've tried tinkering a bit but haven't found the key. Any insight would be very helpful. Thanks.
    – Ron
    Sep 1, 2022 at 22:06

I had to do something similar regarding distrubtion of muni passes. I made it so when you changed the date to today (since they are coming in and getting a physical item, so the date would always be today's date), that it increases the numeric value of a formula field by 1, tracking how many passes they have been given. for me my code was:


I hope this helps anyone in a similar situtation!


Ok so looks like I had the wrong return data type, looking for number and received a date.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .