Write formulas with line breaks in the field

I wish I could write formulas with line breaks so that it’s easier to read, comprehend, and modify. For instance, I wish the first formula could be written like the second. It currently returns an error.

Current:

IF(FIND( “engineer”,LOWER( {Collateral Title})) > 0, “Engineer”,IF(FIND( “engineer”,LOWER( {Overview / Short-form content} )) > 0,“Engineer”,IF(FIND( “engineer”,LOWER( {Preloaded Topic} )) > 0,“Engineer”,IF(FIND( “coding”,LOWER( {Collateral Title} )) > 0,“Engineer”,IF(FIND( “coding”,LOWER( {Overview / Short-form content} )) > 0,“Engineer”,IF(FIND( “coding”,LOWER( {Preloaded Topic} ))>0,“Engineer”, IF(FIND( “developer”,LOWER( {Collateral Title})) > 0,“Engineer”,IF(FIND( “developer”,LOWER( {Overview / Short-form content} )) > 0,“Engineer”,IF(FIND( “developer”,LOWER( {Preloaded Topic} )) >0,“Engineer”,"")))))))))

Desired:

IF(FIND( “engineer”,
LOWER( {Collateral Title})) > 0,
“Engineer”,

IF(FIND( “engineer”,
LOWER( {Overview / Short-form content} )) > 0,
“Engineer”,

IF(FIND( “engineer”,
LOWER( {Preloaded Topic} )) > 0,
“Engineer”,

IF(FIND( “coding”,
LOWER( {Collateral Title} )) > 0,
“Engineer”,

IF(FIND( “coding” ,
LOWER( {Overview / Short-form content} )) > 0,
“Engineer”,

IF(FIND( “coding”,
LOWER( {Preloaded Topic} ))>0,
“Engineer”,

IF(FIND( “developer”,
LOWER( {Collateral Title})) > 0,
“Engineer”,

IF(FIND( “developer”,
LOWER( {Overview / Short-form content} )) > 0,
“Engineer”,

IF(FIND( “developer”,
LOWER( {Preloaded Topic} )) >0,
“Engineer”,

“”)))))))))

You can create formulas with indentation, white space, and the like; however, to do it and still retain your sanity, you probably need to do so using an external editor and paste the complete formula into the formula field. The ability to do so is critical for crafting complex formulas, as you’ve discovered; there is no way I could have written and debugged this, this, or this online.

I copied your second example and (1) corrected for curly quotes ("/" instead of “/”, which the forum adds) and (2) added indentation. This works perfectly well when copied-and-pasted into Airtable:

IF(
    FIND(
        "engineer",
        LOWER(
            {Collateral Title}
            )
        ) > 0,
    "Engineer",

    IF(
        FIND(
            "engineer",
            LOWER(
                {Overview / Short-form content}
                )
            ) > 0,
        "Engineer",

        IF(
            FIND(
                "engineer",
                LOWER(
                    {Preloaded Topic} 
                    )
                ) > 0,
            "Engineer",

            IF(
                FIND(
                    "coding",
                    LOWER(
                        {Collateral Title}
                        )
                    ) > 0,
                "Engineer",

                IF(
                    FIND(
                        "coding" ,
                        LOWER(
                            {Overview / Short-form content}
                            )
                        ) > 0,
                    "Engineer",

                    IF(
                        FIND(
                            "coding",
                            LOWER(
                                {Preloaded Topic} 
                                )
                            )>0,
                        "Engineer",

                        IF(
                            FIND(
                                "developer",
                                LOWER(
                                    {Collateral Title}
                                    )
                                ) > 0,
                            "Engineer",

                            IF(
                                FIND(
                                    "developer",
                                    LOWER(
                                        {Overview / Short-form content}
                                        )
                                    ) > 0,
                                "Engineer",

                                IF(
                                    FIND(
                                        "developer",
                                        LOWER(
                                            {Preloaded Topic}
                                            )
                                        ) >0,
                                    "Engineer",

                                    ""
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

I’m not sure why it was throwing an error, unless it has to do with the quotes; I made no other corrections. (Obviously, I created a scratch table with three fields named the same as yours.)

Personally, I’m a big fan of Notepad++ as an offline editor for Airtable, in part because it does automatic marking of paired parentheses, which makes it easy to find unmatched ones. Np++ is a Windows app, but there are comparable ones available for other OSes.

You’re totally right. I must have just had a typo in there somewhere. Thank you W_Vann_Hall!

And I’ll check out NP++

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.