What's wrong with my formula?

Options

Something very obvious, I am sure:

=COUNTIF({COVID Sick Testing Range 4}, CONTAINS("Positive Rapid", {COVID Sick Testing Range 4}), OR(CONTAINS("Positive PCR", {COVID Sick Testing Range 4})))

Trying to count all Covid-1 positive tests, referencing another sheet.


Thanks!

Answers

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    Options

    Hey @Grace Tidwell

    Try this. I used the COUNTIFS (plural) vs COUNTIF (singular) because the plural version of the function always works, regardless of how many criteria are used, and the singular version only works when a single criteria is used. I don't have to keep up with the number of criteria if using the plural version of the function.

    =COUNTIFS({COVID Sick Testing Range 4}, OR(CONTAINS("Positive Rapid", @cell), CONTAINS("Positive PCR", @cell)))

    Note: If these are the only two responses with the descriptor "Positive" in the name, you could look for just 'Positive' using a single Contains and eliminate the 'OR' condition.

    =COUNTIFS({COVID Sick Testing Range 4}, CONTAINS("Positive", @cell))

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!