# Using CountM to return Count on Specific Items?

Options
✭✭

In the CountM Article is states you can collect a total number however I would like a count of Specific Items. For example how many Pears? How many Apples? Is that possible?

• ✭✭
Options

Sounds similar to something I do. I count all open or closed cases. I also count by department. I use countifs([column name]:[column name], "criteria"). See below my example.

=COUNTIFS([Case Status]:[Case Status], "Open")

• ✭✭
Options

Hi Paul

Thank you for the prompt response. Smartsheet Support also responded as fast as you have. I appreciate it.

Your suggestion did work and so do theirs.

=COUNTIF(Range:Range, HAS(@cell, "Value"))

In the above formula, the Range:Range will be the column in question with the desired values. In the last section of the formula is where you'll define the value, such as HR or IT. Each value will require its own formula, however the only item changing between formulas will be the value at the end.

I was hoping on my Metric sheet that @row would work also to prevent having to type the 13 departments in each row but this working is very helpful

Thanks again!

• edited 01/20/21
Options

Hello @Paul Newcome

I'm looking to do this formula to count items in a column with the condition of X appearing in a multi-select column. My formula troubleshooting keeps popping back as invalid or incorrect arguments. Does anyone have additional advice?

Context: Count # of Red Flags within the flag column IF "XX" appears in a multi-select range.

=COUNTIFS({Range 1}, 1, (CONTAINS("XX",{Range 2})) is the basic syntax but I have also included a screen shot of what I'm currently sitting with.

• ✭✭✭✭✭✭
Options

@Lauren Severe Try this...

=COUNTIFS({Range 1}, 1, {Range 2}, CONTAINS("XX", @cell))

• Options

@Paul Newcome You're the best.

• ✭✭✭✭✭✭
Options
• Options

@Paul Newcome - Hi Paul, I tried this but I get 0 as an answer.

=COUNTIFS([Assigned To]:[Assigned To], CONTAINS("Fred", @cell))

The "Assigned To column" allows multiple contacts per cell.

Am I missing something here?

• ✭✭✭✭✭✭
Options

@Fazel Taslimi Try using a FIND function instead when working with contact type columns.

=COUNTIFS([Assigned To]:[Assigned To], FIND("Fred", @cell) > 0)

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!