Skip to content

Instantly share code, notes, and snippets.

@jaspreetsidhu
Last active October 17, 2019 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaspreetsidhu/66f24c42b011ff634d51a54ab317be55 to your computer and use it in GitHub Desktop.
Save jaspreetsidhu/66f24c42b011ff634d51a54ab317be55 to your computer and use it in GitHub Desktop.
IF(
(NOT(ISBLANK(Population__c)) && ((ISPICKVAL(Type__c, "Borough")) || (ISPICKVAL(Type__c, "County")))),
IF((Population__c / 2) >= 500000, "P10",
IF((Population__c / 2) >= 250000, "P09",
IF((Population__c / 2) >= 125000, "P08",
IF((Population__c / 2) >= 80000, "P07",
IF((Population__c / 2) >= 40000, "P06",
IF((Population__c / 2) >= 20000, "P05",
IF((Population__c / 2) >= 100000, "P04",
IF((Population__c / 2) >= 5000, "P03",
IF((Population__c / 2) >= 2000, "P02",
IF((Population__c / 2) >= 0, "P01"),
NULL))))))))),
IF(NOT(ISBLANK(Population__c)) && (NOT(ISPICKVAL(Type__c, "Borough")) || NOT(ISPICKVAL(Type__c, "County"))),
IF((Population__c) >= 500000, "P10",
IF((Population__c) >= 250000, "P09",
IF((Population__c) >= 125000, "P08",
IF((Population__c) >= 80000, "P07",
IF((Population__c) >= 40000, "P06",
IF((Population__c) >= 20000, "P05",
IF((Population__c) >= 10000, "P04",
IF((Population__c) >= 5000, "P03",
IF((Population__c) >= 2000, "P02",
IF((Population__c) >= 0, "P01",
NULL))))))))))),
IF(ISBLANK(Population__c),
IF((Total_Budget__c) >= 900000, "B10",
IF((Total_Budget__c) >= 250000, "B09",
IF((Total_Budget__c) >= 125000, "B08",
IF((Total_Budget__c) >= 80000, "B07",
IF((Total_Budget__c) >= 40000, "B06",
IF((Total_Budget__c) >= 20000, "B05",
IF((Total_Budget__c) >= 10000, "B04",
IF((Total_Budget__c) >= 5000, "B03",
IF((Total_Budget__c) >= 2000, "B02",
IF((Total_Budget__c) >= 0, "B01",
NULL))))))))))),
NULL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment