Help on NOT function within COUNTIF(S)!

Options

Hi all,

I am trying to create a formula for a sheet summary. I have a "Chem" column that is populated from a form, and could be any one of 26 chem types. I want my summary to return the total number of chems within the Chem column, but I don't want it to include a specific chem, WOS, AND I don't want it to count blank cells.


I tried COUNTIFS function with NOT:
=COUNTIF(Chem:Chem, <>"")NOT(@cell = "WOS")

I almost tried a COUNTIFS and set my criteria as all those chemistries, but I would like to avoid having to type out all 26 kinds in a formula.

But I keep getting either an incorrect argument set or unparsable error every combination I try! And help or advice is well appreciated!!

Tags:

Best Answer

  • bisaacs
    bisaacs ✭✭✭✭✭
    Answer ✓
    Options

    Hey @nroth,

    It looks like you have the brackets in the ranges entered incorrectly. When a column only has one word (like "Chem"), no brackets are required:

    Chem:Chem

    If the column name has spaces/special characters, then you use two sets of brackets:

    [Chem test]:[Chem test]

    If you fix that then it should work!

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

Answers

  • bisaacs
    bisaacs ✭✭✭✭✭
    Options

    Hey @nroth,

    It looks like how you're formatting the formula is incorrect. If you want to use a NOT with a COUNTIFS, then you'd do something like this:

    =COUNTIFS(Chem:Chem, <>"", Range:Range, <>"WOS")

    Hope this helps!

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

  • nroth
    nroth ✭✭✭
    Options

    Hi @bisaacs !

    Thanks for responding to quickly!! I tried that formula you gave me, and it is still giving me an unparsable error. This is the exact formula I put in:

    =COUNTIFS([Chem:Chem], <>"", [Chem]:[Chem], <>"WOS")

    Is it an issue having the same range in the formula for two different expressions? Not sure, but I added a screen shot of the sheet in case that helps!:

    Highlighted is the Chem column in question, they populate from another sheet when conditions are met, hence why I don't want the formula to count blank cells! In this specific scenario, I want it to return "0" under Approved, since it is only the WOS on the sheet. Let me know your thoughts!!

  • bisaacs
    bisaacs ✭✭✭✭✭
    Answer ✓
    Options

    Hey @nroth,

    It looks like you have the brackets in the ranges entered incorrectly. When a column only has one word (like "Chem"), no brackets are required:

    Chem:Chem

    If the column name has spaces/special characters, then you use two sets of brackets:

    [Chem test]:[Chem test]

    If you fix that then it should work!

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

  • nroth
    nroth ✭✭✭
    Options

    @bisaacs

    Oh wow, now I have lots of formulas to update and remove brackets from!! That worked though, thank you so much for all your help!! :)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!