Extract a year from a date column and count current year

I have a date column titled "Date Triaged." I want to count all values in that column for the current year.

I tried this formula but it does not work, it returns #INVLID DATA TYPE. Please help.

=COUNTIF([Date Triaged]:[Date Triaged], YEAR(@cell) = YEAR(TODAY()))

Best Answer

  • Genevieve P.
    Genevieve P. Employee
    Answer ✓

    Hi @Doris F

    Try wrapping an IFERROR around the YEAR function that's looking @cell. The reason we need to add this in is because the @cell is looking into every single cell in the Date Triaged column, including blank cells or cells that contain text (which would return an error, since blank cells don't have any Year).

    =COUNTIF([Date Triaged]:[Date Triaged], IFERROR(YEAR(@cell), 0) = YEAR(TODAY()))


    Cheers,

    Genevieve

    Need more help? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!