I am trying to create a function that performs a special type of preference-matching of certain items with one another.

This special-matching function is essentially just the "Gale–Shapley algorithm" that is best known and expressed (in logic / mathematics) as the "Stable Marriage problem".

So far, I have been completely unsuccessful in finding any sort of online resources that would enable such an algorithm to work in Excel, much less able to find any sources that even talk about it in regards to Excel. I'm starting to think now that, perhaps, this particular algorithm might just be too sophisticated for Excel and/or VBA to manage.

If anyone can please shed some light and offer assistance, I would greatly appreciate it. Is this function even possible in Excel?

In case you are not familiar with the "Stable Marriage problem" and its solution with the Gale-Shapley algorithm, here is a quick video that explains it. Otherwise, you can just google it for a basic Wiki read.

https://www.youtube.com/watch?v=Qcv1IqHWAzg

https://www.youtube.com/watch?v=FIS7hfPfZOE


NOTE: Here is a link to Rosettacode.org, which contains several different language codes to build this Gale-Shapley algorithm.

https://rosettacode.org/wiki/Stable_...ge_problem#Lua


Thank you.