How do you determine what is a valid alternative product? To do it in Excel, you need to have some sort of a rule. If you were going to explain to a human how to do this with a list on paper, what would say? Imagine this is not a very bright human but someone who can follow directions exceptionally well.

Oh, and how do you tell if it's out of stock? It might be useful to attach your file.