What column type is required to use MONTH to return number of new lines in a certain month?

CatB
CatB
edited 03/06/25 in Formulas and Functions

I've been trying to count lines by month, I have the column I want searched set to a date column type.

=COUNTIF([Date Opened]:[Date Opened], MONTH(1))

I'm getting a invalid data type error.

Answers

  • Melissa Yamada
    Melissa Yamada ✭✭✭✭✭

    Hello @CatB

    It looked like your Date column has either an empty cell or a non-date value so you need to account it using an IFERROR function. Since having either an empty cell or a non-date value will throw an error and that causes the #INVALID DATA TYPE error message.

    Try this:

    =COUNTIF([Date Opened]:[Date Opened], IFERROR(MONTH(@cell ), 0) = 1)

    Melissa Yamada
    melissa@insightfulsheets.com
    Data made simple, spreadsheets reimagined

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!