Created Date, error when referenced in formula
{Date Submitted} is a cross-sheet reference to a column of Created (Date). {Total Findings} is a cross-sheet reference to a column of numbers generated via a formula. [Week Number]@row is a primary column with numbers in it. Formula 1 below works fine. However, formula 2 returns a #INVALID DATA TYPE. How is this possible? This seems very nonsensical to me.
Formula 1:
=SUMIF({Date Submitted}, WEEKNUMBER(@cell) = [Week Number]@row, {Total Findings})
Formula 2:
=COUNTIFS({Date Submitted}, WEEKNUMBER(@cell) = [Week Number]@row, {Total Findings}, @cell > 0)
Best Answer
-
Okay, so apparently having an empty value in the date column will cause the error.... Is it just me or shouldn't the function be built to ignore the empty rows or is there a use case I'm not considering?
This is required for COUNTIFS but not SUMIFS, which is confusing to me. This is the solution:
=COUNTIFS({Date Submitted}, IFERROR(WEEKNUMBER(@cell), 0) = [Week Number]@row, {Total Findings}, @cell > 0)
We can return zero for the weeknumber because whatever value is returning error is not a date anyways, and there is no such thing as week 0, so we do not have to worry about accidentally counting that row.
This forum post got me to realize what the issue was:
https://community.smartsheet.com/discussion/51441/countifs-with-date
Answers
-
Okay, so apparently having an empty value in the date column will cause the error.... Is it just me or shouldn't the function be built to ignore the empty rows or is there a use case I'm not considering?
This is required for COUNTIFS but not SUMIFS, which is confusing to me. This is the solution:
=COUNTIFS({Date Submitted}, IFERROR(WEEKNUMBER(@cell), 0) = [Week Number]@row, {Total Findings}, @cell > 0)
We can return zero for the weeknumber because whatever value is returning error is not a date anyways, and there is no such thing as week 0, so we do not have to worry about accidentally counting that row.
This forum post got me to realize what the issue was:
https://community.smartsheet.com/discussion/51441/countifs-with-date
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 472 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