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.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!