How to compare multiple values in two rows, and return a different result based on the outcome of comparing ALL values? Is there a better way than nested IFs?

What I’m trying to do is compare a “recipe” row with an “available inventory” row, and return “Yes” only if there are enough of all components in inventory to do the recipe.

Something that looks like this:

            bits     pieces    bobs      can make?
recipe      1        2         2         -
available   4        1         3         No
available   3        7         2         Yes

I would like the software to figure out whether I have enough bits AND enough pieces AND enough bobs, and tell me based on that whether I can make the recipe or not.

I can do that with nested IFs, but the rows in my actual file have 15+ values each and I will be repeating the process with multiple pairs of rows, so I would like to know if there is an easier or more elegant solution I don’t know about yet. Thank you!

It can be done with an array formula.
The array formula compares cell by cell in the defined ranges (which must be, of course, of the same length).
It can also be done with the SUMPRODUCT function.
Recipe.ods (10.9 KB)

1 Like

That’s exactly the tools I needed! Thank you so much :smile: