Stumped - Index(Collect)
Hello, I am stumped on why a formula is not working. The below formula should return the next milestone in a project plan. This uses cross sheet references.
=IFERROR(INDEX(COLLECT({Phase/Milestone}, {IsMilestone}, true, {Start Date}, >Today@row), 1), "")
{Phase/Milestone} is text column of project Phases or Milestones.
{IsMilestone} is a checkbox column when the row is a milestone
Start Date is the Start Date column for the project plan
Today @row refers to a column that uses an automation to update the date in the column to the current day - this column is on the sheet with the formula and the automation runs daily.
The problem is, I get no response. Everything seems to be in order in the sheet - there is text in the Phase/Milestone column, the box is checked in the IsMilestone column and the Today column has has the correct date.
Any suggestions?
Best Answer
-
Happy to help. 👍️
The logic used in your formula won't necessarily return the earliest date. The COLLECT function pulls a list together of all rows that match the range/criteria sets from top to bottom with no special sorting or anything. The INDEX/1 pulls the first entry from the list generated by the COLLECT function.
If you wanted to skip rows where the {Phase/Milestone} is blank, you would add another range/criteria set saying as much.
=IFERROR(INDEX(COLLECT({Phase/Milestone}, {Phase/Milestone}, @cell <> "", ……………………………….
Answers
-
What do you get if you remove the IFERROR portion?
-
Oddly, I get nothing. Just a blank cell. I also tried adding test to the IFError ("Error", instead of "").
-
So that means you are getting at least one row found that matches the range/criteria sets of the box being checked and the date being in the future, but the first row that matches that criteria is blank in the {Phase/Milestone} range. Try applying a filter to the source sheet to match the range/criteria sets and see if this is true.
-
Paul, Thank you for your help with this. I appreciated the order of the logic that you bring to this. I have checked all of the columns, and there is text, boxes checked and dates. I have checked this multiple times.
I changed the reference in the Index range (it was looking at Phase/Milestone), so that it was looking at tasks, and it returned a task, though it was not on the row I would have thought, it was a with a start date 1 day later (12/24/24 rather that 12/23/24). I was under the impression that this would always return the first cell that matched the criteria.
-
@Paul Newcome Thank you for your help, it help me finally figure it out!
-
Happy to help. 👍️
The logic used in your formula won't necessarily return the earliest date. The COLLECT function pulls a list together of all rows that match the range/criteria sets from top to bottom with no special sorting or anything. The INDEX/1 pulls the first entry from the list generated by the COLLECT function.
If you wanted to skip rows where the {Phase/Milestone} is blank, you would add another range/criteria set saying as much.
=IFERROR(INDEX(COLLECT({Phase/Milestone}, {Phase/Milestone}, @cell <> "", ……………………………….
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!