3
IF (
    AND (
        ts2__Job__c.Days_Search_Open__c >= 0, 
        ts2__Job__c.Days_Search_Open__c <= 4
    ), 
    "0 - 4",
    IF (
        AND (
            ts2__Job__c.Days_Search_Open__c >= 5, 
            ts2__Job__c.Days_Search_Open__c <= 8 
        ),
        "5 - 8",
        IF (
            AND (
                ts2__Job__c.Days_Search_Open__c >= 9, 
                ts2__Job__c.Days_Search_Open__c <= 18
            ),
            "9 - 18",
            IF (
                AND (
                    ts2__Job__c.Days_Search_Open__c >= 19, 
                    ts2__Job__c.Days_Search_Open__c <= 30
                ), 
                "19 - 30",
                IF (
                    AND (
                        ts2__Job__c.Days_Search_Open__c >= 31, 
                        ts2__Job__c.Days_Search_Open__c <= 60
                    ),
                    "31 - 60",
                    IF (
                        AND ( 
                            ts2__Job__c.Days_Search_Open__c >= 61,
                            ts2__Job__c.Days_Search_Open__c <= 90
                        ),
                        "61 - 90",
                        IF (
                            ts2__Job__c.Days_Search_Open__c >= 91,
                            "91+",
                        )
                    )
                )
            )
        )
    )
)

I am attempting to group ranges of days and getting this error:

Warning

Error when encoding row-level formula: Syntax error. Found ')'

1
  • 3
    Upvote just for your editing. Thanks for indenting it out, helps a ton with questions of this nature.
    – Adrian Larson
    Dec 3 '21 at 17:45
7

Your last IF block has no value_if_false.

What you have

IF (
    ts2__Job__c.Days_Search_Open__c >= 91,
    "91+",
)

What you need

IF (
    ts2__Job__c.Days_Search_Open__c >= 91,
    "91+",
    "SOME OTHER VALUE (Missing)"
)

Please note that your formula can be simplified a bit by defining only the top end of each range, if you are willing to add a <0 bucket.

IF(My_Field_Path__c < 0, "<0",
    IF(My_Field_Path__c < 5, "0-4",
        IF(My_Field_Path__c < 9, "5-8",
            IF(My_Field_Path__c < 19, "9-18",
                IF(My_Field_Path__c < 31, "19-30",
                    IF(My_Field_Path__c < 61, "31-60",
                        IF(My_Field_Path__c < 91, "61-90", "91+")
                    )
                )
            )
        )
    )
)

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.