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
-
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
-
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
-
Thank you so much @Genevieve P. . I really appreciate the correction and the added bonus (the explanation)!!!!!
-
No problem at all! I'm glad I could help. 🙂
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!