Index, Match, Max, Collect
I am trying to use the following formula to identify the name of the last Manager in Training (MIT) to graduate their training program with a certain Mentor, but wherever there are instances of MITs having the same graduation date, the formula is returning the wrong MIT for the given Mentor, and I cannot figure out why. Any help would be greatly appreciated.
(INDEX({MIT Grads}, MATCH(MAX(COLLECT({Grad Date 2}, {Mentor}, [Mentor Contact]@row)), {Grad Date 2}, 0))
Best Answer
-
@Mary_B I would suggest inserting a helper date column onto your Mentor List Sheet. Move your MAX/COLLECT for the dates over to there.
Then you can use an INDEX/COLLECT like so...
=IFERROR(INDEX(COLLECT({MIT Grads}, {Grad Date 2}, [Date Helper]@row, {Mentor}, [Mentor Contact]@row), 1), "")
Answers
-
Hi @Mary_B
Hope you are fine, Please add a copy of your sheet or a screenshot (after removing or replacing any sensitive information). This will make it easier for me to provide the appropriate answer to your question.
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
-
Thank you so much for your help!
-
Are you able to provide some screenshots with mock data entered that shows the issue? It is hard to tell if there are multiples of the same name, and I do not see duplicate dates anywhere to get an idea of exactly what is going on vs what should be happening.
-
Thanks for responding @Paul Newcome!
Please see mock sheets below showing the following formula error:
According to the MIT Training Roster, the last MIT that Silvia Smith mentored was Jennifer Lynn; however, because Jennifer has the same Graduation Date as Julie Smith, the formula in the Mentor List is returning Julie Smith as the last MIT mentored by Silvia, which is not accurate (Julie was mentored by James Smith).
Thanks so much for your help!
-
@Mary_B I would suggest inserting a helper date column onto your Mentor List Sheet. Move your MAX/COLLECT for the dates over to there.
Then you can use an INDEX/COLLECT like so...
=IFERROR(INDEX(COLLECT({MIT Grads}, {Grad Date 2}, [Date Helper]@row, {Mentor}, [Mentor Contact]@row), 1), "")
-
@Paul Newcome Worked like a charm!! Thanks so much!!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.9K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 458 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!