Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

COUNTIFS with HAS/CONTAINS not working

Employee
edited 02/27/25 in Formulas and Functions
This discussion was created from comments split from: Counts of values in a multi-select column.

Answers

  • ✭✭✭✭

    I'm getting an unparseable on my formula below for picking up every instance of DME.

    =COUNTIFS({Services}, CONTAINS([Description], $Description@row, {Created}, IFERROR(YEAR(@cell ), 0) = YEAR(TODAY()))

    This one is not picking them all up. I tried to change Has to Contains, but still same #

    =COUNTIFS({Services}, HAS(@ ), {Created}, YEAR(@cell ) = YEAR(TODAY()), {Services}, $Description@row)

  • Community Champion

    Hi @Amy Swan,

    You do want HAS for this:

    =COUNTIFS({Services}, HAS(@cell, "DME"), {Created}, YEAR(@cell) = YEAR(TODAY()))

    I'm not sure what the extra bit at the end of your formula is being used for here - if you are using the description row to put in the different options (e.g. DME) and then doing the formula based off that, then it would be something like this:


    =COUNTIFS({Services}, HAS(@cell, Description@row), {Created}, YEAR(@cell ) = YEAR(TODAY()))

    Hope this helps, but if I've misunderstood something or you've still any problems/questions just let us know! 🙂

  • ✭✭✭✭

    This worked! Thank you so much!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions