Counifs Dates from 3 columns

Stephanie Kiecker
Stephanie Kiecker ✭✭✭✭
edited 01/12/24 in Formulas and Functions

I have searched the threads and tried so may formula options and none worked...hoping someone can help me figure out why my formula is not counting the number of text occurances in three different cells in my sheet

Here is my sheet:


and in my Total Minor field I want to show the number of occurrences of the word "Minor" in the three highlighted cells

My current formula is:

=COUNTIFS([Dorm Cleanliness Grading & Benchmark ID]@row, CONTAINS("Minor", @cell), [Adequate Living Space Grading & Benchmark ID]@row, CONTAINS("Minor", @cell), [Exterior Build. Appearance Grading & Benchmark ID]@row, CONTAINS("Minor", @cell))

This formula is resulting in a count of only "1" instead of the correct number "3"

Can anyone help fix this issue?

Best Answer

  • Genevieve P.
    Genevieve P. Employee Admin
    Answer ✓

    Hi @Stephanie Kiecker

    Think of the COUNTIFS as saying "and" between your criteria... it's counting if the current row contains "minor" in this cell, and if it contains "minor" in this other cell, and if it contains "minor" in the third cell. If all 3 criteria are met, it counts the row (meaning the count = 1). Instead, it sounds like you want to count each instance of "minor".

    Here you'll want 3 separate count statements added together, like so:

    =COUNTIF(cell, criteria) + COUNTIF(cell, criteria) + COUNTIF(cell, criteria)

    Try:

    =COUNTIF([Dorm Cleanliness Grading & Benchmark ID]@row, CONTAINS("Minor", @cell)) + COUNTIF([Adequate Living Space Grading & Benchmark ID]@row, CONTAINS("Minor", @cell)) + COUNTIF([Exterior Build. Appearance Grading & Benchmark ID]@row, CONTAINS("Minor", @cell))

    Cheers,

    Genevieve

Answers

  • Genevieve P.
    Genevieve P. Employee Admin
    Answer ✓

    Hi @Stephanie Kiecker

    Think of the COUNTIFS as saying "and" between your criteria... it's counting if the current row contains "minor" in this cell, and if it contains "minor" in this other cell, and if it contains "minor" in the third cell. If all 3 criteria are met, it counts the row (meaning the count = 1). Instead, it sounds like you want to count each instance of "minor".

    Here you'll want 3 separate count statements added together, like so:

    =COUNTIF(cell, criteria) + COUNTIF(cell, criteria) + COUNTIF(cell, criteria)

    Try:

    =COUNTIF([Dorm Cleanliness Grading & Benchmark ID]@row, CONTAINS("Minor", @cell)) + COUNTIF([Adequate Living Space Grading & Benchmark ID]@row, CONTAINS("Minor", @cell)) + COUNTIF([Exterior Build. Appearance Grading & Benchmark ID]@row, CONTAINS("Minor", @cell))

    Cheers,

    Genevieve

  • BRILLIANT!! That worked!! Thank you so much!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!