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
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!