Skip to main content
I'm having some trouble with a formula I'm building out, Basically I want this formula field to assign a number (1,2,0) based on a student's grade field and whether they're on track on community service hours they've completed which is determined by dividing the community service hours field on the student page by their schools community service hour requirement. I keep getting an error that reads, Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 4. I've tried to read through other posts that had similar questions but I'm not sure where I need to change my particular formula to get it to work. Below is the formula.

 

Thank you!

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 9, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  >= 0.25,

 

"2",

 

IF(NUMBER_SYSTEM_Current_Grade__c = 9, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  >0,

 

"1",

 

IF(NUMBER_SYSTEM_Current_Grade__c = 9, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c <0.25, 

 

"1",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 10, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  >= 0.50,

 

"2",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 10, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  >= 0.25,

 

"1",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 10, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  < 0.50,

 

"1",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 11, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  >= 0.75,

 

"2",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 11, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  >= 0.50,

 

"1",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 11, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  < 0.75,

 

"1",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 12, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  >= 1,

 

"2",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 12, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  >= 0.75,

 

"1",

 

IF(NUMBER_SYSTEM_Current_Grade__c  = 12, Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c  < 1,

 

"1",

 

"0"))))))))))))
5 respostas
  1. 18 de jun. de 2018, 17:27
    Create another Formula Field

    that will have a Formula - 

    Community_Service_Hours__c / CPE_Partner_High_School__r.Community_Service_Hour_Requirement__c

     

    Let's keep the Return Type as = Number with a Label - Hours Achieved

     

    Then amend your Formula like this = 

    CASE(

        NUMBER_SYSTEM_Current_Grade__c,

        9, 

            IF(Hours_Achieved__c >= 0.25, 2,

            IF(Hours_Achieved__c > 0, 1, NULL)),

        10,

            IF(Hours_Achieved__c >= 0.50, 2,

            IF(Hours_Achieved__c > 0, 1, NULL)),

        11,

            IF(Hours_Achieved__c >= 0.75, 2,

            IF(Hours_Achieved__c > 0, 1, NULL)),

        12,

            IF(Hours_Achieved__c >= 1, 2,

            IF(Hours_Achieved__c > 0, 1, NULL)),

        NULL

    )

0/9000