Countifs for a specific month

The AI-generated formula shows an invalid data type. I'm not sure what is wrong. What I want to do is count the number of items that are good for the month of December.

=COUNTIFS([Fault Severity]:[Fault Severity], "good", MONTH([Last Update]:[Last Update]), 12)

Best Answers

  • Kerry St. Thomas
    Kerry St. Thomas ✭✭✭✭✭✭
    edited 12/04/24 Answer ✓

    I am not absolutely certain, but I think the issue is you're trying to do a MONTH evaluation (parsing of something with type Date) in what will eventually be a Text column. I suggest you create a helper column of "Last Update"

    =MONTH([Last Update]@row)

    Then you can subtly change your formula to be:

    =COUNTIFS([Fault Severity]:[Fault Severity],"good",[Last Update Month]:[Last Update Month],12)

    If this is a sheet that holds data from other years, remember this will count ALL the Decembers and not just THIS December - so be sure that's what you're aiming for with your specific use case.

    Good luck!

    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!

  • Jeremy_D
    Jeremy_D ✭✭✭
    Answer ✓

    An invalid data type is usually due to the type of column you are inputting the formula in not being able to show the answer of the formula. It's likely that you've inputted this formula into a date column? You'll need to change it to a Text/Number column.

    Hope that helps unless I've misunderstood.

Answers

  • Kerry St. Thomas
    Kerry St. Thomas ✭✭✭✭✭✭
    edited 12/04/24 Answer ✓

    I am not absolutely certain, but I think the issue is you're trying to do a MONTH evaluation (parsing of something with type Date) in what will eventually be a Text column. I suggest you create a helper column of "Last Update"

    =MONTH([Last Update]@row)

    Then you can subtly change your formula to be:

    =COUNTIFS([Fault Severity]:[Fault Severity],"good",[Last Update Month]:[Last Update Month],12)

    If this is a sheet that holds data from other years, remember this will count ALL the Decembers and not just THIS December - so be sure that's what you're aiming for with your specific use case.

    Good luck!

    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!

  • Jeremy_D
    Jeremy_D ✭✭✭
    Answer ✓

    An invalid data type is usually due to the type of column you are inputting the formula in not being able to show the answer of the formula. It's likely that you've inputted this formula into a date column? You'll need to change it to a Text/Number column.

    Hope that helps unless I've misunderstood.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!