Finding the closest date today with 2 columns of dates
Hi,
I am working on a formula to show the next date from 2 rows of dates. I tried =MAX(COLLECT([Release]:[Release], [Live]:[Live], >TODAY())) - and it showed a date from the past.
I tried
=MIN(COLLECT([Release]:[Release ], [Live]:[Live], >TODAY()))
With the same results.
Any help is much appreciated.
Best Answer
-
OK, try this: =MIN(MIN(COLLECT(Release:Release, Release:Release, >TODAY())), MIN(COLLECT(Live:Live, Live:Live, >TODAY())))
And make sure the column type for that is Date.
Answers
-
The COLLECT Function needs both the values range and the criterion range to be given before the criterion, and then can do it again for another values range. Right now your COLLECT function is returning the min/max Release date from rows where Live dates are greater than today.
See the help page here:If you're trying to get the minimum date after today among all the Release and Live dates listed in those twocolumns, try something more like: MIN(COLLECT([Release]:[Release], [Release]:[Release], >TODAY(), [Live]:[Live], [Live]:[Live], >TODAY()))
-
Hi Courtney,
Thank for answering this question.
I had the collect function in the formula. I tried the formula you gave me and on both accounts it returned with #INVALID OPERATION - I am not sure why but the brackets keep getting removed from the formula every time I hit enter.
-
Hi @Paisdais,
I believe this will give you what you are looking for.
=MIN(MIN(COLLECT(Release:Release, Release:Release, >TODAY()), MIN(COLLECT(Live:Live, Live:Live, >TODAY()))))
Hope this helps,
Dave
-
Thank you @DKazatsky2 - I tried the formula and got INVALID OPERATION. Did I do something wrong when entering the formula??
-
OK, try this: =MIN(MIN(COLLECT(Release:Release, Release:Release, >TODAY())), MIN(COLLECT(Live:Live, Live:Live, >TODAY())))
And make sure the column type for that is Date.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!