Skip to main content

Hi! I am struggling to get this formula to work. The goal is IF Requires_Custom_Rappel_Rate__C checkbox is TRUE, assign value based on the value of Rate_of_Rappel__C, then IF Requires_Custom_Rappel_Rate__C checkbox is FALSE, assign value based on the value of Rappel_Height__C    This is what I currently have for the formula but it keeps coming back with an error:  IF( Requires_Custom_Rappel_Rate__c = TRUE,  

 

IF( Rate_of_Rappel__c ="8", 62, 

  IF( Rate_of_Rappel__c <="7", 54,

     IF( Rate_of_Rappel__c <="6", 46, 

       IF( Rate_of_Rappel__c <="5", 38,

          IF( Rate_of_Rappel__c <="4", 30,

              IF( Rate_of_Rappel__c <="3", 22,

                   IF( Rate_of_Rappel__c <="2", 14, NULL )))))))), 

 

IF( Requires_Custom_Rappel_Rate__c = FALSE, 

 

IF ( Rappel_Height__c  <= 200, 46,   

      IF( Rappel_Height__c  <= 330, 38, 

          IF( Rappel_Height__c  <= 400, 30, 

              IF( Rappel_Height__c  <= 500, 22, 

                  IF( Rappel_Height__c   >  500, NULL  , NULL, NULL )))))))    

 

@Formulas - Help, Tips and Tricks 

3 respostas
  1. 6 de fev., 14:39

    @Sydni Jardine - You’re very close — the main issues are:

    1. You don’t need IF(checkbox = TRUE, …) / IF(checkbox = FALSE, …) in Salesforce formulas. A checkbox field is already boolean, so use it directly.
    2. Your last height IF has too many arguments: IF(condition, true, false) only takes 3 parameters, but you have 4: NULL, NULL, NULL. That will throw an error.
    3. Your “rate” section mixes "8" (text) with <= comparisons (numeric-style). Use numbers if the field is numeric, or TEXT() if it’s a picklist/text.

     

    If Rate_of_Rappel__c is a Number data type

    IF(  Requires_Custom_Rappel_Rate__c,  CASE(    Rate_of_Rappel__c,    8, 62,    7, 54,    6, 46,    5, 38,    4, 30,    3, 22,    2, 14,    NULL  ),  IF(    Rappel_Height__c <= 200, 46,    IF(      Rappel_Height__c <= 330, 38,      IF(        Rappel_Height__c <= 400, 30,        IF(          Rappel_Height__c <= 500, 22,          NULL        )      )    )  ))

    If Rate_of_Rappel__c is a Picklist/Text field type

    IF(  Requires_Custom_Rappel_Rate__c,  CASE(    TEXT(Rate_of_Rappel__c),    "8", 62,    "7", 54,    "6", 46,    "5", 38,    "4", 30,    "3", 22,    "2", 14,    NULL  ),  IF(    Rappel_Height__c <= 200, 46,    IF(      Rappel_Height__c <= 330, 38,      IF(        Rappel_Height__c <= 400, 30,        IF(          Rappel_Height__c <= 500, 22,          NULL        )      )    )  ))  
0/9000