Countifs formula using CONTAINS
Hi all,
I am currently working on a crosssheet formula that is trying to determine how many projects are listed as a specific health for a specific person listed in a multiselect drop down. I have been able to determine how to get this formula to work, but only for cells that have one person listed.
=COUNTIFS({Overall Project Health}, "Yellow", {Assigned To}, "Bob Jones")
If there is another person listed in the Assigned To field with Bob, the formula will not count that project. I think I need to add CONTAINS into this formula, but am struggling with how to make it work.
Any help is appreciated.
Thanks,
Andrea
Best Answers

Can you post the exact formula that is giving you the error using copy/paste directly from the sheet to here?

Thank you for the quick response, Paul! After working through this a bit more we have figured it out.
Answers

Hi Andrea,
I struggled with this one as well. Here's what I used and has worked for me:
=COUNTIFS([Campaign Priority]:[Campaign Priority], CONTAINS("Capital Project", @cell))
This is looking at a column named Campaign Priority which is set as a multiselect drop down.
Hope this helps!
Ally

Hi Ally,
I am referring to cells in a different sheet so when I reference the other sheet I am using the curly brackets. I tried your suggestion above but am still receiving and 'INVALID OPERATION' error.
=COUNTIFS({Overall Project Health}, "Green", {Assigned To}, CONTAINS("Bob Jones"))
Any other ideas?

You are only missing the second portion of the CONTAINS functions.
=COUNTIFS({Overall Project Health}, "Green", {Assigned To}, CONTAINS("Bob Jones", @cell))

Hi Paul  this doesn't give me an error, but I'm not getting the correct answer. What is the @cell looking at in a crosssheet reference? Is it looking at the entire column I am referencing? Thanks!

The @cell reference simply tells the formula to evaluate the entire range on a cell by cell basis instead of counting the entire range as a single piece. If you are not getting the correct answer, then you are going to want to reevaluate your data. Make sure that the entries you think should be counted actually contain "bob space jones" and not "bob space space jones" or other such discrepancies. Extra spaces are not visible when viewing a cell but will become apparent when you enter a cell to edit.
The bottom cell is a copy/paste of the top cell. It shows where the additional spaces are not shown even though they are there.

Hmm... I am still getting an error: INCORRECT ARGUMENT SET. Any other thoughts?

Can you post the exact formula that is giving you the error using copy/paste directly from the sheet to here?

Thank you for the quick response, Paul! After working through this a bit more we have figured it out.
Help Article Resources
Categories
Check out the Formula Handbook template!