RESOLVED: AVG(Collect) Formula Returning #InvalidDataType
Hello,
First, thank you to all the formula gurus who lend your time to help us with our broken formulas!
My Task: calculate average response time per fiscal year.
The Formula Used:
=AVG(COLLECT([Response Time]:[Response Time], [Allotted Plan Review Time]:[Allotted Plan Review Time], "30", [Fiscal Year]:[Fiscal Year], "2025"))
Formula Breakdown:
[Response Time]:[Response Time] - Range to Average
[Allotted Plan Review Time] - Criteria 1, search for allotted time that equals 30 days
[Fiscal Year] - search for fiscal year that is equal to 2025
Issue: I've reviewed and followed the rules of other avg(collect) questions/answers. The trouble in my formula begins when I include the Fiscal Year. Fiscal Year formula references a date column but returns a number (ex: 2025)
Fiscal Year Column is calculated as follows:
=IF([FYcal: Month]@row < 7, [FYCal: Year]@row, [FYCal: Year]@row + 1)
The sheet I am using is a running index from all time. I need averages per fiscal year. Any suggestions/recommendations would be greatly appreciated.
Answers
-
Are all the values in your Response Time column numbers?
-
@Corey W. - Yes, but there are some blank spaces for rows that we have not yet responded to.
-
Try defaulting those to zero or adding a condition to your collect function to ignore the blanks. I think sometimes AVG functions get mad at non-numbers.
-
I'm not so sure that's the issue.
I've calculated the average response time for all time with blank spaces and it returned a value. The problem is when I add the fiscal year portion to the formula. That's when the formula fails.
-
I'd also remove the quotes from around the 2025 and 30… you don't need those and it treats them as text vs a number.
-
@Nic Larsen - Thanks for the response. Just tried that and still the same result.
-
@Corey W. - piggybacking off your response about blank fields, further down in the sheet I found some error cells in the Fiscal Year column. Currently working to populate those cells with a date to see if that will fix the problem.
Will report back.
-
@Corey W. - Thank you for mentioning the blank spaces!
I had to take a deep dive in my sheet to find some of the rows did not populate a Fiscal Year! Once I entered the information for the fiscal year to populate, it returned the necessary value. Thanks again!!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.4K Get Help
- 364 Global Discussions
- 200 Industry Talk
- 429 Announcements
- 4.4K Ideas & Feature Requests
- 137 Brandfolder
- 129 Just for fun
- 128 Community Job Board
- 446 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 284 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!