# Counting items within a cell

Options

Hi team,

I am wanting to keep track of why people are exiting the company on a monthly basis.

I have the following formula which works perfectly if the exiting employee only selects ONE reason why they are leaving -

=COUNTIFS({HR-559 Exit Interview Range 1}, OR(@cell = "Better job"), {HR-559 Exit Interview Range 2}, AND(IFERROR(MONTH(@cell), 0) = Month@row, IFERROR(YEAR(@cell), 0) = Year@row))

But if within that cell they selected "Better job" and "Relocation" it would return 0 instead of 1 for the Better Job category.

How do I get the formula to count "Better job" when there are multiple options selected within the cell?

Tags:

• ✭✭✭✭✭✭
Options

Hello @Josephine

The HAS or CONTAINS functions are functions to use when dealing with multiselect cells (cells that contain multiple values in same cell)

=COUNTIFS({HR-559 Exit Interview Range 1}, CONTAINS("Better job",@cell), {HR-559 Exit Interview Range 2}, AND(IFERROR(MONTH(@cell), 0) = Month@row, IFERROR(YEAR(@cell), 0) = Year@row))

Will this work for you?

Kelly

• ✭✭✭✭✭✭
Options

Hello @Josephine

The HAS or CONTAINS functions are functions to use when dealing with multiselect cells (cells that contain multiple values in same cell)

=COUNTIFS({HR-559 Exit Interview Range 1}, CONTAINS("Better job",@cell), {HR-559 Exit Interview Range 2}, AND(IFERROR(MONTH(@cell), 0) = Month@row, IFERROR(YEAR(@cell), 0) = Year@row))

Will this work for you?

Kelly

• Options

Thank you! That has worked perfectly!

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!