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
Leo PalloLeo Pallo 

How do I calculate the number of mounths between a specific date and the end of the year?

Hi,
 
My name is Leo, and I work in a customer care software development in Brazil.
We're on Enterprise edition and I'm trying to figure out how to calculate the number of mounths between a specific date and the end of the year.
 
Does someone could help me with this issue?
 
In advance, sorry about my english, it´s not so good.
 
Leo
pmozz01pmozz01

You will likely need a couple of custom formula fields to complete your entire calculation.  I will give you examples of how I am calculating dates.  I have these fields hidden on the page layouts so that I get my calculations, but none of the users need to see the fields.  I'm not sure what "specific date" you are trying to calculate from -if it were the "created date" of a record (or expiration date, etc.) you would create a formula like this: Month({!CreatedDate}) or  MONTH({!SLAExpirationDate__c} ) - so you would now have the number of the month that you are going to subtract from the number of months in the year.

Next, you want to create another custom formula field that takes the number result of the field above.  For example,

12 - {!field above}

I forgot to mention that you are creating a formula field with a formula return type of number.

Your result is the number of months between the specific date and the end of the year.  If you have trouble understanding this, contact me at pmozz07@hotmail.com with a more specific description of what you are trying to do.

Leo PalloLeo Pallo

Thanks pmozz01, for your help.

Best Regards.

 

Leo