You are on page 1of 2

The Diet Problem

http://excelcalculations.blogspot.com
This spreadsheet finds the cheapest diet that fullfils a set of specified nutritional requirements. It is based on the work of George Stigler this problem in the 1940s
Read the full blog post here

Step 1: Specify your desired nutritional requirments by setting the upper and lower bounds
Step 2: Specify a list of possible foods and their nutritional information (you can find a database of foods and their nutritional content at http://www.nutritiondata.com)
Step 3: Use Excel's Solver to minimize the total cost while maintaining the nutrional requirements between their upper and lower bounds
Sample Solver settings are saved in cells A33:A57

Calories Fat Saturated Trans Cholesterol Sodium Carbs Fibre Sugar Protein Vitamin Vitamin Calcium Iron Constraints used in Solver
(Kcal) (g) fat (g) fat (g) (mg) (mg) (g) (g) (g) (g) A (IU) C (mg) (mg) (mg)
Nutritional bounds Min 1900 30 0 0 0 1500 150 20 0 50 3000 300 1000 18
on optimized diet Max 2200 75 25 2 300 2300 300 50 50 160 7000 40

Serving Cost per Optimum


Food Nutrition per portion Number of
size Portion ($)
Portions
Donut 60g 239 11 3 0 18 232 30 1 12 4 13.8 0.7 27.6 2.2 0.85 0
Bagel, Oat Bran 57g 145 1 0 0 0 289 30 2 1 6 2.3 0.1 0.8 1.8 0.85 2.85041947
Yogurt,fruit,non fat 125g 119 0 0 0 2 72 24 0 24 6 15 0.9 190 0.1 1.25 0
Chili 216g 190 8 3 0 25 1040 17 5 5 14 1250 36 80 1.4 2.5 0
Brocolli,boiled,no sal140g 49 1 0 0 0 57 10 5 2 3 2167 90.9 56 0.9 0.4 0.98740093
Apple 182g 95 0 0 0 0 2 25 4 19 0 98.3 8.4 10.9 0.2 0.4 0
Oats,instant,dry 328g 105 2 0 0 0 72 19 3 0 4 1000 0 98.5 8.2 0.5 2.12003161
Orange,raw,navel 140g 69 0 0 0 0 1 18 3 12 1 346 82.8 60.2 0.2 0.3 1.18139795 Cells to be
changed
Lentils,cooked,no sal100g 116 0 0 0 0 2 20 8 2 9 8 1.5 19 3.3 0.35 3.12722507 by Solver
Carrots, baby raw 28g 10 0 0 0 0 22 2 1 1 0 3861 0.7 9 0.2 0.3 0
Brussel sprout, cook 78g 28 0 0 0 0 16 6 2 1 2 604 48.4 28.1 0.9 0.5 2.22003358
Chicken, roast, no ski140g 234 9 3 0 105 105 0 0 0 35 57.5 0 16.8 1.7 1.5 2.27583208
Blueberries, raw 28g 16 0 0 0 0 0 4 1 3 0 15.1 2.7 1.7 0.1 0.6 0
Spinach,boiled, no sa180g 41 0 0 0 0 126 7 4 1 5 18870 17.6 245 6.4 0.3 0
Banana, raw 118g 105 0 0 0 0 1 27 3 14 1 75.5 10.3 5.9 0.3 0.3 0
Milk 1%, added vit A 244g 102 2 2 0 12 107 13 0 13 8 478 0 290 0.1 0.5 1.73257842
Nutrition in Optimized Diet 1900 32 10.292653 0 259.7533092 1500 255.32 50 50 155.826 7000 300 1000 40
TOTAL COST OF CHEAPEST DIET 10.716835
Saved solver settings
Cell to be minimized
10.7168350037 by Solver
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
32767
0

You might also like