That's going to involve iterations to check combinations.. I can't immediately think of an efficient formula solution.. you would need VBA probably to do the iterating... which, unfortunately, is out of my scope here....
Hopefully someone can offer a VBA solution.. or an alternative that I haven't thought of for you.
Bookmarks