Count If with Symbols?

fiorellag
fiorellag
edited 07/11/24 in Formulas and Functions

I am trying to label the overall health of my projects

  • If all symbols on my range are green, I want the overall cell to have a green symbol.
  • If one or more symbols on my range are yellow, I want the overall cell to have a yellow symbol.
  • If one or more symbols on my range are red, I want the overall cell to have a red symbol.

If a symbol can't be entered with a formula on the overall health column, maybe label them as

  • Healthy
  • At Risk
  • Blocked

I need this so I can create a chart on my dashboard.

Please and thank you!

Best Answers

  • Kerry St. Thomas
    Kerry St. Thomas ✭✭✭✭✭✭
    Answer ✓

    You can use a COUNTIF as you usually would. Just use the WORDS instead of the SYMBOL (and of course make your Overall Health column to be Type Symbol too). The formula is along these lines:

    =IF(COUNTIF(Resources@row:Budget@row, "Red") > 0, "Red", IF(COUNTIF(Resources@row:Budget@row, "Yellow") > 0, "Yellow", "Green"))

    There are two "danger spots" on this formula to be aware of:
    —If there's a blank item in the symbol column, this formula will return a Green Health. You may want to consider if you need to highlight blank items in your overall health to accommodate for this.
    —Because the range of symbols is looked at, it'll include add new symbol columns inside that range - but if you add columns to either the left or the right, the formula won't adjust to accommodate those additions.

    If this answer resolves your question, please help the Community by marking it as an accepted answer. I'd also be grateful for your response - "Insightful"or "Awesome" reactions are much appreciated. Thanks!

  • fiorellag
    fiorellag
    Answer ✓

    Thank you Kerry! This worked!

Answers

  • Kerry St. Thomas
    Kerry St. Thomas ✭✭✭✭✭✭
    Answer ✓

    You can use a COUNTIF as you usually would. Just use the WORDS instead of the SYMBOL (and of course make your Overall Health column to be Type Symbol too). The formula is along these lines:

    =IF(COUNTIF(Resources@row:Budget@row, "Red") > 0, "Red", IF(COUNTIF(Resources@row:Budget@row, "Yellow") > 0, "Yellow", "Green"))

    There are two "danger spots" on this formula to be aware of:
    —If there's a blank item in the symbol column, this formula will return a Green Health. You may want to consider if you need to highlight blank items in your overall health to accommodate for this.
    —Because the range of symbols is looked at, it'll include add new symbol columns inside that range - but if you add columns to either the left or the right, the formula won't adjust to accommodate those additions.

    If this answer resolves your question, please help the Community by marking it as an accepted answer. I'd also be grateful for your response - "Insightful"or "Awesome" reactions are much appreciated. Thanks!

  • fiorellag
    fiorellag
    Answer ✓

    Thank you Kerry! This worked!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!