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
- Customer Resources
- 64.8K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 67 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!