CONTAINS not identifying all the instances

2»

Answers

  • MKRS
    MKRS ✭✭

    Hi Paul,

    The page is full of confidential information and if i blacked it out you wouldn't see anything!

  • Brian_Richardson
    Brian_Richardson Overachievers Alumni
    edited 05/30/24 Answer ✓

    Since you're trying to count for combinations of specific people and specific Treatment Plans, I would setup a sheet to do that analysis.

    Setup a sheet that has a column for the Person Interacted With, Country, Start/End dates (date columns), and a column for each of the Treatment Plan options.

    Then setup column formulas for each Treatment Plan column like this:

    =COUNTIFS({PersonInteract}, HAS(@cell,[Person Interacted With]@row), {Country}, Country@row, {Date}, >=[Start Date]@row, {Date}, <=[End Date]@row, {HospitalCourse}, HAS(@cell,"Name of column / course to search for"))

    For example, in the "Discharge Plan" column the formula would be:

    =COUNTIFS({PersonInteract}, HAS(@cell,[Person Interacted With]@row), {Country}, Country@row, {Date}, >=[Start Date]@row, {Date}, <=[End Date]@row, {HospitalCourse}, HAS(@cell,"Discharge Plan"))

    The cross sheet references in this formula point to columns on your data sheet.

    When done you should have a sheet something like this that will count for each combination that you're looking for. You can add as many rows as you need to account for as many combinations as you want to count for. I've included rows for another country too like USA.

    BRIAN RICHARDSON | PMO TOOLS AND RESOURCES | HE|HIM

    SEATTLE WA, USA

    IRON MOUNTAIN

  • MKRS
    MKRS ✭✭

    Hi Brian,

    That has seemed to have worked!

    Many thanks for your help it was appreciated.

    Michelle

  • Brian_Richardson
    Brian_Richardson Overachievers Alumni

    You're welcome!

    Some other suggestions:

    • I'm not sure how you're determining date ranges, but you might want to automate that so that you don't have to constantly create rows that calculate for different ranges. For example, if your date ranges are always the previous month, you could create a formula for Start Date like this that would set start date to the first day of the month prior to the current month: = DATE(YEAR(TODAY()),MONTH(TODAY()) -1,1)
    • For ease of reading the metric sheet you could also use some hierarchy, that won't change the formulas but could make it easier to parse. For example, have a parent row for South Korea and then indent the various combinations of person and date.
    • If you need to sum up totals across your metric sheet, you can do that in the Summary Fields on the right side of the sheet. That's a great place to put formulas that count or sum up entire columns for your use. You can then put these on a summary report for your reporting and dashboarding needs.

    Good luck!

    BRIAN RICHARDSON | PMO TOOLS AND RESOURCES | HE|HIM

    SEATTLE WA, USA

    IRON MOUNTAIN

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!