COUNTIF year is current
Can anyone tell me what is wrong with this formula for counting rows containing the current year?
=COUNTIF([Date Completed]:[Date Completed], YEAR(@cell) = YEAR(TODAY()))
Best Answers
-
Ok. It may be that you have blanks or non-date values within the column. Lets try an IFERROR...
=COUNTIF([Date Completed]:[Date Completed], IFERROR(YEAR(@cell), 0) = YEAR(TODAY()))
-
There were some blanks and that fixed it. Thank you!
Answers
-
It looks ok to me. Are you getting an error or an incorrect count?
-
Getting #INVALID DATA TYPE error in the Sheet Summary, but Date Completed is a date field.
-
Ok. It may be that you have blanks or non-date values within the column. Lets try an IFERROR...
=COUNTIF([Date Completed]:[Date Completed], IFERROR(YEAR(@cell), 0) = YEAR(TODAY()))
-
There were some blanks and that fixed it. Thank you!
-
Happy to help. 👍️
Help Article Resources
Categories
Check out the Formula Handbook template!