function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Otilia StraitOtilia Strait 

Combination of IF conditions

Hi all,

I'm trying to create a custom formula field where I need to insert multiple conditions.

IF ( Invoicing_type_2__c = 3, "CPM"),
IF ( Invoicing_type_2__c = 4, "vCPM"),
IF ( Invoicing_type_2__c = 5, "vCPM"),
IF ( Invoicing_type_2__c = 6, "vCPM"),
))))

But I'm doing something wrong as I'm receiving multiple erros. (e.g. Extra ,).

Can you please help me on this topic?

Thank you,
Otilia
Ajay K DubediAjay K Dubedi
Hi Otilia,

As I can see you did not include null in Last at 'if' condition,
 
IF ( Invoicing_type_2__c = 3, "CPM"),
IF ( Invoicing_type_2__c = 4, "vCPM"),
IF ( Invoicing_type_2__c = 5, "vCPM"),
IF ( Invoicing_type_2__c = 6, "vCPM"),
Null))))

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
Deepali KulshresthaDeepali Kulshrestha
Hi Otilia,

Please add NULL at the end of your condition.

See my formula below:

IF ( Invoicing_type_2__c = 3, "CPM"),
IF ( Invoicing_type_2__c = 4, "vCPM"),
IF ( Invoicing_type_2__c = 5, "vCPM"),
IF ( Invoicing_type_2__c = 6, "vCPM"),
NULL ))))

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too

Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com
Udit BansalUdit Bansal
Hi Otilia,

Try this :
 
IF ( Invoicing_type_2__c = 3, 
       "CPM",
       IF ( Invoicing_type_2__c = 4, 
             "vCPM",
              IF ( Invoicing_type_2__c = 5, 
                   "vCPM",
                    IF ( Invoicing_type_2__c = 6,
                          "vCPM",
                           NULL 
                     )
              )
        )
)

Thanks 
Udit Bansal