CountIF won't recognise the result of a formula

I have a column that contains a column formula driven from a date.

GRID COLUMNS

Detection Date = DD/MM/YY

Year = formula: =20 + RIGHT([Detection Date]@row, 2). Result = 2023

Sheet summary

This Year = formula: =20 + RIGHT(TODAY(), 2). Result today = 2023

Breach This Year = formula: =COUNTIF(Year:Year, [This Year]#). Result = 0 (should count 113 instances of 2023).

The COUNTIF formula simply will not recognise the 2023 in the Year column. Even if i change the formula to state =COUNTIF(Year:Year, 2023) or put 2023 in "", the result is always the same as 0.

How can I update my COUNTIF to recognise the value of 2023 in the Year column?

Best Answer

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    If you are using a date type column, you can just use the YEAR function directly within the COUNTIF and not worry about the helper column with the year in it at all.

    =COUNTIFS([Detection Date]:[Detection Date], IFERROR(YEAR(@cell), 0) = YEAR(TODAY())

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!