Last active
March 18, 2017 13:11
-
-
Save bdunagan/d17c7d96efbdfd1962355a8580aa5a6c to your computer and use it in GitHub Desktop.
Salesforce: Add an Opportunity formula field for "Days since release"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Salesforce Custom Formula for "Days Since Release" based on Opportunity CloseDate | |
IF( | |
/* 2012 - Win 8, Mac 10 */ | |
AND( | |
CloseDate >= DATE(2012,11,6), | |
CloseDate < DATE(2014,3,4) | |
), | |
CloseDate - DATE(2012,11,6), | |
IF( | |
/* 2014 - Win 9, Mac 11 */ | |
AND( | |
CloseDate >= DATE(2014,3,4), | |
CloseDate < DATE(2015,3,17) | |
), | |
CloseDate - DATE(2014,3,4), | |
IF( | |
/* 2015 - Win 10, Mac 12 */ | |
AND( | |
CloseDate >= DATE(2015,3,17), | |
CloseDate < DATE(2016,3,1) | |
), | |
CloseDate - DATE(2015,3,17), | |
IF( | |
/* 2016 - Win 11, Mac 13 */ | |
AND( | |
CloseDate >= DATE(2016,3,1), | |
CloseDate < DATE(2017,3,7) | |
), | |
CloseDate - DATE(2016,3,1), | |
IF( | |
/* 2017 - Win 12, Mac 14 */ | |
AND( | |
CloseDate >= DATE(2017,3,7), | |
CloseDate < DATE(2018,3,1) | |
), | |
CloseDate - DATE(2017,3,7), | |
10000 | |
) | |
) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment