Using Index/Match in Many to One search to Check a Checkbox
I am trying to use an Index/Match function to connect two sheets, a Fleet Task sheet and a Fleet Inventory. I would like the function to search through the Task sheet and it finds tasks with a status of "Not Started" or "In Progress" to mark a checkbox associated with that vehicle in the Inventory.
I ran into an issue when trying to use just an IF function because I think when it matches the vehicle ID once, it stops cycling through the rows. I think I need some combination of the IFERROR and IF functions.
This function is successful only if all the tasks for a vehicle are the same status (ie. completed), but not if there's a mix of completed and pending work.
=IF((INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "In Progress"), true, false)
I also tried to use the IFERROR, but I'm not sure how to add the true/false piece that will mark the checkbox once matched.
=IFERROR(IFERROR(INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "Not Started"), INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "In Progress")), INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "Extended"))
Best Answer
-
Sorry about that. I missed the part where it needed to cycle through. You are right in that it matches the first value and doesn't continue. The way to solve for this sort of issue in Smartsheet is to use a helper column to combine the values you are looking to find and then searching for that.
For instance, you could have a helper column (on the source sheet if it is different) with the following formula:
- =IF(OR([Fleet Task Assignments - Status]@row="Not Started", [Fleet Task Assignments - Status]@row="In Progress"),[Fleet Task Assignments - Vehicle ID]@row+" Incomplete","")
Then you could have your search column look like this:
=IFERROR(IF(MATCH([CPC fleet #]@row + " Incomplete", {Fleet Task Assignments - Vehicle ID}, 0)>0, true, false), false)
I hope this helps!
Best,
Zach Hall
Training Delivery Manager / Charter Communications
Answers
-
This should do it:
- =IFERROR(IF(OR(INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "Not Started"), INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "In Progress", INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "Extended"), True, False), False)
Hope this helps!
Best,
Zach Hall
Training Delivery Manager / Charter Communications
-
Hi Zack!
Thanks for the quick reply. I removed an extra parenthesis, and now it looks like this:
=IFERROR(IF(OR(INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "Not Started", INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "In Progress", INDEX({Fleet Task Assignments - Status}, MATCH([CPC fleet #]@row, {Fleet Task Assignments - Vehicle ID}, 0)) = "Extended"), true, false), false)
But all my values still come back as False. I added a test record, one dummy vehicle with one associated dummy task "Not Started", and that comes back true. I think it's still not cycling through all the values in the task sheet.
-
Sorry about that. I missed the part where it needed to cycle through. You are right in that it matches the first value and doesn't continue. The way to solve for this sort of issue in Smartsheet is to use a helper column to combine the values you are looking to find and then searching for that.
For instance, you could have a helper column (on the source sheet if it is different) with the following formula:
- =IF(OR([Fleet Task Assignments - Status]@row="Not Started", [Fleet Task Assignments - Status]@row="In Progress"),[Fleet Task Assignments - Vehicle ID]@row+" Incomplete","")
Then you could have your search column look like this:
=IFERROR(IF(MATCH([CPC fleet #]@row + " Incomplete", {Fleet Task Assignments - Vehicle ID}, 0)>0, true, false), false)
I hope this helps!
Best,
Zach Hall
Training Delivery Manager / Charter Communications
-
Thank you! That helped. I implemented a similar approach with a COUNTIF on the statuses plus Match@row and then used an IF function to identify rows with counts greater than 1 to activate my checkbox.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.9K Get Help
- 379 Global Discussions
- 210 Industry Talk
- 441 Announcements
- 4.5K Ideas & Feature Requests
- 139 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 300 Events
- 33 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!