Help w/COUNTIFS and multiple NOT(CONTAINS) functions
Hi team - I created a formula to count the number of numbers of errors in a specific month and does NOT CONTAIN "general counsel" in the Division Requested By column, the June example works:
June example formula:
=COUNTIFS([Main row]:[Main row], 1, Created:Created, IFERROR(MONTH(@cell), 0) = 6, [Incorrect format]:[Incorrect format], 1, [Division requested by]:[Division requested by], NOT(CONTAINS("general counsel", @cell)))
I now need to add another NOT(CONTAINS) formula to not count "Low" items in the IRR column but I can't seem to get the formula right. I'm using:
=COUNTIFS([Main row]:[Main row], 1, Created:Created, IFERROR(MONTH(@cell), 0) = 7, [Incorrect format]:[Incorrect format], 1, [Division requested by]:[Division requested by], NOT(CONTAINS("general counsel", @cell), IRR:IRR, NOT(CONTAINS("low", @cell))))
What am I missing?
Best Answer
-
It is just a misplaced parenthesis. You closed out your first CONTAINS, but didn't close out the NOT associated with it.
=COUNTIFS([Main row]:[Main row], 1, Created:Created, IFERROR(MONTH(@cell), 0) = 7, [Incorrect format]:[Incorrect format], 1, [Division requested by]:[Division requested by], NOT(CONTAINS("general counsel", @cell)), IRR:IRR, NOT(CONTAINS("low", @cell)))
Adding in that closing parenthesis (in bold) and removing one from the end should clear up the issue for you.
Answers
-
Hi @lewis hamilton - unfortunately I have too many criteria in the IRR column and it's "easier" to figure out what NOT to count vs including every possible option of the items that need to be counted. In my case, I have a 2 NOT(CONTAINS) to use for 2 different columns.
-
It is just a misplaced parenthesis. You closed out your first CONTAINS, but didn't close out the NOT associated with it.
=COUNTIFS([Main row]:[Main row], 1, Created:Created, IFERROR(MONTH(@cell), 0) = 7, [Incorrect format]:[Incorrect format], 1, [Division requested by]:[Division requested by], NOT(CONTAINS("general counsel", @cell)), IRR:IRR, NOT(CONTAINS("low", @cell)))
Adding in that closing parenthesis (in bold) and removing one from the end should clear up the issue for you.
-
@lewis hamilton Smartsheet does not have a SUMPRODUCT function built in.
-
@Paul Newcome - doh, the dreaded missing parenthesis!!!!! That did the trick - thanks so much!!!
-
Happy to help. 👍️
And yes. Those parenthesis can be a pain. I also have problems with forgetting square brackets sometimes too. Those aren't too bad in Smartsheet because you don't get all of the colors and end up with an error, but here in the Community I tend to forget them sometimes. Haha.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!