I am trying to create, possibly an Excel spreadsheet to assist in this as the quantities can change, and will change, as this problem is executed. Unless someone can offer a better way, but here goes:

I have a variety of foods, and a varying quantity of each food item. These foods make dishes, each dish has a varying quantity requirement (aka “serving”) of the food items used in that dish (ie. Dish 1 uses 2 eggs and dish 2 uses 5). And each dish has a different value to “earn” each time you can you make it.

Using the eggs example, say I have 100 eggs and dish 1(d1) has a value of 10 and dish 2(d2) has a value of 30. If I use all my eggs to make only d2 I can earn (20egg servings x value 30) 600. Or if I use all my eggs to make only d1 I can earn (50egg servings x value 10) 500.
Clearly the better value is to make only d2.
However, each dish can have 4-7 different food elements to each that may be required for a higher value dish.
This is a very simplified version of what I am working with.

What’s the best way I can input my food items and their quantities, and the individual dishes with their food items and servings and varying earning values to figure out the best way to use my foods to “earn” the most value?

I’ll open this up for conversation because I welcome questions to help clarify what I might not have explained fully.