You need to sign in to do that
Don't have an account?
qlarion
Creating a formula that assigns a number to a day of the year
Does anyone know a way to assign a numeric value to the days left in a year? I need to come up with a formula for Current Fiscal Year Revenue where CFY Revenue = [Days left in Current FY/365] x Order Amount and I do not know how to get a numeric value for "Days left in Current FY" from Salesforce.
Thanks,
Laura
The below given code finds the days remaining in the current year. Its in JavaScript.
today=new Date()var endofyear=new Date(today.getFullYear(), 11, 31)var one_day=1000*60*60*24
//Calculate difference btw the two dates, and convert to daysdocument.write("<b>"+Math.ceil((endofyear.getTime()-today.getTime())/(one_day))+"</b> days remaining this year!")
Laura -
If you want to go the standard formula route, this should work:
365 - (TODAY() - DATE(YEAR(TODAY()), 1, 1) + 1)