0

I need to add some lines into a formula and I started it but I'm stopped with the following issue : Incorrect number of parameters for function 'IF()'. Expected 3, received 4. I saw there's another post that have quite the same name/issue but it didn't helped me.

My formula is at the end of this message. I don't succeed in finding where the issue is (it says expected 3 and received 4, but where ?). I checked the number of parentheses and the fact that each IF has 3 elements, maybe I missed something here (or elsewhere I didn't thought about)... Could someone please take a look at it to help me ?

IF(Premiere_adhesion_cette_annee__c, 
    $Label.ACC_FIDELITE_NOUVEAU,
    IF(Adherent_exercice_courant__c,  
        IF(Adherent_exercice_precedent__c, 
            $Label.ACC_FIDELITE_FIDELE, 
            $Label.ACC_FIDELITE_REACTIVE 
        ),
        IF(NOT(ISBLANK(Date_de_premiere_adhesion__c)),
            IF(Demissionnaire_exercice_courant__c,                
                $Label.ACC_FIDELITE_DEMISSIONNAIRE,
                IF(adherent_exercice_precedent__c,      
                    $Label.ACC_FIDELITE_ENATTENTE,
                    $Label.ACC_FIDELITE_A_RELANCER
                )
            ),
            $Label.ACC_FIDELITE_PROSPECT
        )
    ),
    $Label.ACC_FIDELITE_PROSPECT
)

1 Answer 1

2

Formatting it like it were code helps, so thanks for that!

If you remove the contents of the second IF(), just to help visualize things, you'll see that your outermost IF() looks like this:

IF(
    Premiere_adhesion_cette_annee__c, /* parameter 1 */
    $Label.ACC_FIDELITE_NOUVEAU,      /* parameter 2 */
    IF(
     ...                              /* parameter 3 */
    ),
    $Label.ACC_FIDELITE_PROSPECT      /* parameter 4 */
)

So your 4 parameter IF() is the outermost one

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .