# Formula help - Countifs, contains, and adding an OR function

Options

Hi Smartsheet Experts:

I am working on a formula and have gotten stuck. I have a countifs formula, and I need to change it to count customers with either Product A or Product B (some have both) - I can't figure out how to insert an "OR" function into the formula without breaking it.

Right now the formula is actually written as 2 formulas: Status for Product A + Status for Product B. I don't want to double-count customers with product A and B.

Here is the current formula:

=COUNTIFS({Status}, "Completed", {Content Type}, CONTAINS([type]@row, @cell), {Products}, CONTAINS("Product A", @cell)) + COUNTIFS({Status}, "Completed", {Content Type}, CONTAINS([type]@row, @cell), {Products}, CONTAINS("Product B", @cell))

Any ideas?

Thanks!

Tags:

• ✭✭✭✭✭✭
Options

Give this one a go...

=COUNTIFS({Status}, "Completed", {Content Type}, CONTAINS([type]@row, @cell), {Products}, OR(CONTAINS("Product A", @cell), CONTAINS("Product B", @cell)))

• ✭✭✭✭✭✭
Options

Give this one a go...

=COUNTIFS({Status}, "Completed", {Content Type}, CONTAINS([type]@row, @cell), {Products}, OR(CONTAINS("Product A", @cell), CONTAINS("Product B", @cell)))

• Options

Thanks Paul - it worked - you are a lifesaver!

• ✭✭✭✭✭✭
Options

Happy to help. 👍️

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!