1

I am having issues with a formula that uses NOT(CONTAINS and AND below:

IF(NOT(Contains("House:platform SF.API:Chris:NULL",Business_Manager__c)),Business_Manager__c,
    IF(CONTAINS("House:platform SF.API:Chris:NULL",Sales_Ops_Contact__c),Acct_Manager__c,
    IF(And(CONTAINS("House:platform SF.API:Chris:NULL"),Business_Manager__c,
        NOT(CONTAINS("House:platform SF.API:Chris:NULL")),Sales_Ops_Contact__c,Sales_Ops_Contact__c, NULL))))

Receiving 2, expected 1 error.

I have been staring at this for hours and cannot find the issue :/

2
  • 1
    can you put the logic you want to achieve Feb 4, 2017 at 1:11
  • The goal is to have the statement use each of the TRUE portions for each IF statement, ELSE null. (True portions are just every "manager" field after each if statement
    – Geo
    Feb 4, 2017 at 1:14

2 Answers 2

1

CONTAINS operator will take 2 arguments where you were passing one. I think you are trying to achieve like this:

IF(
    NOT(Contains("House:platform SF.API:Chris:NULL",Business_Manager__c)),
    Business_Manager__c,
    IF(
        CONTAINS("House:platform SF.API:Chris:NULL",Sales_Ops_Contact__c),
        Acct_Manager__c,
        IF(
            And(
                CONTAINS("House:platform SF.API:Chris:NULL",Business_Manager__c),
                NOT(CONTAINS("House:platform SF.API:Chris:NULL",Sales_Ops_Contact__c))),
                Sales_Ops_Contact__c, 
                NULL              
          )
      )
)

Also, instead of using AND operator in IF() condition you can use &&, that will end up less brackets.

IF(
    NOT(Contains("House:platform SF.API:Chris:NULL",Business_Manager__c)),
    Business_Manager__c,
    IF(
        CONTAINS("House:platform SF.API:Chris:NULL",Sales_Ops_Contact__c),
        Acct_Manager__c,
        IF(CONTAINS("House:platform SF.API:Chris:NULL",Business_Manager__c) &&
                NOT(CONTAINS("House:platform SF.API:Chris:NULL",Sales_Ops_Contact__c)),
                Sales_Ops_Contact__c, 
                NULL              
          )
      )
)
3
  • 1
    Teach a man to fish! What were they doing wrong?
    – Adrian Larson
    Feb 4, 2017 at 1:26
  • Hi @Santanu_Boral , I have tried your suggestion. One thing I changed was the ) at the end of the NOT(CONTAINS which needed another Parentheses. I am still receiving the error. I am not sure if after the ` IF(CONTAINS("House:platform SF.API:Chris:NULL",Business_Manager__c) && NOT(CONTAINS("House:platform SF.API:Chris:NULL"),Sales_Ops_Contact__c), Sales_Ops_Contact__c, NULL is correct. This statement should state Sales Ops Contact, ELSE Null for the entire clause.
    – Geo
    Feb 4, 2017 at 3:41
  • I have updated the ans Feb 4, 2017 at 4:07
2
IF(And(CONTAINS("House:platform SF.API:Chris:NULL"),Business_Manager__c

This line here, CONTAINS only has one parameter. You should have the closing parentheses after the next parameter.

IF(And(CONTAINS("House:platform SF.API:Chris:NULL",Business_Manager__c),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.