# How to use a formula for SUMIFS with more than 2 not contains criteria?

Options
edited 12/22/22

If I have 3 columns one is "department", the second is "description", and the third is "amount".

I would like to sum up the total "amount" for only department-1 in the "department" column, that doesn't contains "ABC" or "EFG" or "JKL" in the description column.

I am trying to use =SUMIFS({amount}, {department},{department-1},OR(NOT(CONTAINS("ABC", @cell),("EFG",@cell),("JKL",@cell)))}

• ✭✭✭✭✭✭
Options

Each piece of the OR function will be a separate NOT/CONTAINS.

OR(NOT(CONTAINS("ABC", @cell)), NOT(CONTAINS("EFG", @cell)))

• Options

I used this:

=SUMIFS({amount}, {department}, {department -1}, {description}, OR(NOT(CONTAINS("ABC", @cell)), NOT(CONTAINS("EFG", @cell)), NOT(CONTAINS("JKL", @cell))))

it summed up the total amount in the column without applying the "NOT CONTAIN" condition.

• ✭✭✭✭✭✭
Options

Apologies. Swap the OR function for an AND function.

"EFG" isn't "ABC", so it will still grab "EFG". If we switch to an AND function instead, it will exclude all three.

Sorry about that. I was just looking at the syntax and not necessarily the desired outcome.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!