Index-Collect

charish
charish
edited 03/10/25 in Formulas and Functions

I have a feature column, a task (multiple tasks per feature) column, a task date column and a feature date column.

The task dates can be of three different types.

  1. They can be all dates.
  2. They can be dates and "DFD + Date" (example: DFD 3/10/2025)
  3. TBDs

Once the feature, task and task date columns are filled, I want to automatically populate the feature date column (same value across all tasks for that feature):

  1. I want the formula to return max date if all the values across all tasks for a specific feature are dates (type 1)
  2. I want the formula to return the the first DFD value if there are both dates and "DFD + Date" (type 2)
  3. I want the formula to return TBD, if there is only TBD (type 3)

The formula i have:

=IF(CONTAINS("TBD", COLLECT([Task Date]:[Task Date], [Feature]:[Feature], [Feature]@row)), "TBD", IF(CONTAINS("DFD", COLLECT([Task Date]:[Task Date], [Feature]:[Feature], [Feature]@row)), INDEX(COLLECT([Task Date]:[Task Date], [Feature]:[Feature], [Feature]@row, [Task Date]:[Task Date], CONTAINS(@cell, [Task Date]@row)), 2), MAX(COLLECT([Task Date]:[Task Date], [Feature]:[Feature], [Feature]@row))))

  1. I want to automate the row_index in the index function to return the first index where the DFD value is found
  2. For type 2, if there are both dates and DFDs, I am getting a invalid value error

Sorry for the long message and appreciate your help.

Best Answers

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!