Syntax with a mix of or, and, contains and not

Hello All,

My formula is:

=IF(OR([Box Shrubs#]@row >= 2, AND([Box Shrubs#]@row = 1, NOT(CONTAINS("hedge", [FN: Pruning]@row),1, "")))))

So basically, if the number at box shrubs is greater and equal to 2 then mark box; OR if box shrubs is equal to one AND the cell Fn: pruning does not contain hedge, then mark box

I keep getting syntax issues or @#incorrect argument.

Best Answer

  • Melissa Yamada
    Melissa Yamada ✭✭✭✭✭
    Answer ✓

    Hello @Craig Lemberger

    You're parenthesis at the end are causing the issue.

    It should be:

    =IF(OR([Box Shrubs#]@row >= 2, AND([Box Shrubs#]@row = 1, NOT(CONTAINS("hedge", [FN: Pruning]@row)))),1, "")

    Once you're creating a formula there is a reference that shows up that will help you identify whether you're in a logical statement, value if yes, value if false, or criteria of any function. You can utilize that to identify why your formula is throwing an error message:

    Melissa Yamada
    melissa@insightfulsheets.com
    Data made simple, spreadsheets reimagined

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!