YEAR function in cross-sheet reference COUNTIFS
I am working on a metrics sheet where I'd like to count the number of items that a given department has implemented within in a specific year.
In this formula {Date Implemented} is a cross sheet reference to a date column (MM/DD/YYYY) and the matching criteria is a cell that contains the year value, in this example "2024". Naturally, this doesn't get counted in the countifs as is, because 2024 != 03/11/2024.
=COUNTIFS({Date Implemented}, $[2024]$1, {Department}, [Primary Column]@row, {Status}, "Implemented")
So, I added a YEAR function in the formula, expecting that the below would pull the year "2024" from "03/11/2024" and be counted. Instead, I receive an INVALID DATA TYPE error.
=COUNTIFS(YEAR({Date Implemented}), $[2024]$1, {Department}, [Primary Column]@row, {Status}, "Implemented")
I ended up adding a helper column in the source sheet and applied the YEAR function there so I have Year Implemented and the below worked just fine. BUT I don't understand why I couldn't nest the YEAR function in my metrics sheet. My metric sheet column type is text/number. {Date Implemented} does have null values in the source sheet, because not everything is implemented - could that be it?
Workaround formula using helper column {Year Implemented} on source sheet, which worked, for reference.
=COUNTIFS({Year Implemented}, $[2024]$1, {Department}, [Primary Column]@row, {Status}, "Implemented")
Answers
-
Trying to understand this part of your formula $[2024]$1
Why wouldn't you just put the 2024 in your formula.
=COUNTIFS(YEAR({Date Implemented}), 2024, {Department}, [Primary Column]@row, {Status}, "Implemented")
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64K Get Help
- 412 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 138 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives