Multiple dates meeting criteria causing #INVALID DATA TYPE error
So I'm using this formula to find the earliest date that isn't a blank out of a column, and when I only have one date that's in the column and is greater than or equal to today the formula returns the correct date or "No Project Scheduled" appropriately. However, when I have two or more dates that meet that same criteria the formula throws a #INVALID DATA TYPE error.
=IF(COUNTIF({Estimated Shoot Date}, >=TODAY()), MIN(COLLECT({Estimated Shoot Date}, {Estimated Shoot Date}, @cell <> "", {Estimated Shoot Date}, >=TODAY())), "No Project Scheduled")
Best Answer
-
Try saying "if the count is greater than zero:
=IF(COUNTIF({Estimated Shoot Date}, >=TODAY()) > 0, MIN(COLLECT({Estimated Shoot Date}, {Estimated Shoot Date}, @cell <> "", {Estimated Shoot Date}, >=TODAY())), "No Project Scheduled")
Without it (assuming there are three dates for example) you are saying
=IF(3, MIN(COLLECT(...........
The reason it works when there is one or zero is because one and zero also equal true and false.
Answers
-
Try saying "if the count is greater than zero:
=IF(COUNTIF({Estimated Shoot Date}, >=TODAY()) > 0, MIN(COLLECT({Estimated Shoot Date}, {Estimated Shoot Date}, @cell <> "", {Estimated Shoot Date}, >=TODAY())), "No Project Scheduled")
Without it (assuming there are three dates for example) you are saying
=IF(3, MIN(COLLECT(...........
The reason it works when there is one or zero is because one and zero also equal true and false.
-
That did it, thanks Paul!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.5K Get Help
- 424 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 145 Just for fun
- 62 Community Job Board
- 465 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!