You need to sign in to do that
Don't have an account?
Can you help me figure out how to calculate the age of a business?
What's up
Is there a way to use the TODAY or YEAR (or some other one) functions to take a static number in a field and calculate an amount of time?
What I'm getting at is, if a company submits a lead today and tells us they've been in business for 10 years, is there a way to write a formula that will say 11 years next year, 12 years two years from now, etc? I'm a brand new admin so my developing skills are pretty much non-existent. You guys are geniuses as far as I'm concerned.
I love you.
Hi Jeremy,
What you can do is - create one field that will save the date the business was established:
for e.g. Date Established(date type)
Create another field " years in business" which is a formula field which can calculate the difference between date established and today's date:
Use the following Formula for the field to calculate the difference between the two dates:
(YEAR(TODAY()) *12+MONTH(TODAY()) +((IF(MONTH(TODAY()) = MONTH( date_established__c ), 0, 1)) - (YEAR(date_established__c) * 12 + MONTH(date_established__c))))/12
Each time you view the record - years established will be recalculated and you will see the updated number of years in business.
Hope this helps!
All Answers
Hi Jeremy,
What you can do is - create one field that will save the date the business was established:
for e.g. Date Established(date type)
Create another field " years in business" which is a formula field which can calculate the difference between date established and today's date:
Use the following Formula for the field to calculate the difference between the two dates:
(YEAR(TODAY()) *12+MONTH(TODAY()) +((IF(MONTH(TODAY()) = MONTH( date_established__c ), 0, 1)) - (YEAR(date_established__c) * 12 + MONTH(date_established__c))))/12
Each time you view the record - years established will be recalculated and you will see the updated number of years in business.
Hope this helps!
Sonam-
Thank you so much! When I paste in your code and check the syntax, I get this error:
Incorrect parameter type for function 'MONTH()'. Expected Date, received Number
Any idea what to do about that?
Thank you!!
Jeremy
Hey Jeremy,
Could you please check the return of the formula field to make sure it is number and not date.
The days in business will return a number so make sure the return type is set to number.
let me know..
Hi Jeremy,
Could you please message me your ORG ID together with support login access(http://login.salesforce.com/help/doc/en/granting_login_access.htm) and name of Object and field that you have created so I can troubleshoot this issue further.