Saturday, December 18, 2010

Spreadsheeting To Victory

So, one thing I've wanted to do for years is construct nutritionally optimized meals. It's a tough problem, because each food has different ratios of each nutrient; so stacking up a set of ingredients and quantities, that all add up to an optimized ingredient list, is hard.

And I cracked it! Turns out I was looking at it all wrong. I'd been thinking I wanted software that would do all the calculations for me. But actually it's much better to just automate a few little things that help narrow down which foods are available to add into my ingredient list.

So, here's what I did. I made a spreadsheet that had a bunch of foods, and a column for each nutrient; and I filled in the nutrients with an equation that would change the quantities of each nutrient to reflect the quantity of that particular food.

So if I put the quantity of green peas at 1 cup, all the nutrients adjust their values accordingly.

At the top of the spreadsheet is a special area, and if I move a food into that area, then it's part of my ingredient list, and I can see a summation of the nutritional values of all the foods on that list. So as I add each food, it shows me the total percent of the RDA I'd get from eating all the foods combined on that list.

That was what I was doing for awhile, and it worked a little, but not great. Through a lot of diligence and trial and error, I was able to cobble together a list of about 14 foods, mainly in 1/4 cup portions, that would add up to a complete nutritional balance, with a reasonable caloric intake.

But the real coolness was when I added a new column to the spreadsheet, that would give each food a score. At first I just averaged the values of each nutrient that the food contained; so the score essentially represented how nutritionally 'dense' that food was. And that was useful, in the sense that nutritionally dense foods are great to include in ingredient lists; but it wasn't as helpful as it could be, in terms of helping me pick exactly which food to add to a given ingredient list.

So then what I did was, I told the scoring function to take account of the ingredient list that was already up in the special part of the spreadsheet. For any given nutrient, if I still needed some of that nutrient, I'd include that value in the average. If the ingredient list already had enough of that nutrient, I wouldn't include it in the average. And, if any nutrient would put the ingredient list over the medically recommended maximum for that nutrient, that would send the food's score down to 0. In other words, I wouldn't consider it at all.

All of a sudden, the whole problem became easy!

The way it is now, using this mechanism, if a food has a high score, that means it will be directly beneficial to add to the ingredient list. So I just sort the spreadsheet on the 'score' column, and then select the next food for the ingredient list from the top items in the sheet.

In practice, this enables me to focus a lot more on which foods I think would taste good together.

So, here's an example of an ingredient list I've constructed with this technique:


2 cups Corn
2 cups Peas
2 cups Shiitake
2 tins Sardines
1 cup Almonds

That ingredient list gives me a relatively low caloric intake - but still 90% of the RDA, so it's good for weight loss. At the same time, it gives a virtually complete set of nutrients, with no nutrients going too high or too low. I'm no expert and you shouldn't rely on this information, but as far as I can tell, the above recipe gives me everything I need for a full day's eating.

Also, there are only 5 ingredients, with reasonable portions, instead of the 14 ingredients divvied up in 1/4 cup increments that I had to deal with before.

So, unlike the old days, where it was really hard to come up with even a single ingredient list that would meet my needs, now I can do it over and over. My master list of ingredients so far is still relatively small - only about 25 items - so there still tends to be some overlap. But now that I have the spreadsheet working, I'll be adding a lot more items to it as I discover more good foods.

Here's another ingredient list I figured out:


2 cups Lima Beans
2 cups Broccoli
2 cups Butternut Squash
1 cup Clams (canned)
1 cup Shiitake
1 cup Edamame
1/8 cup Almonds
1/8 cup Sesame Seeds


This one is a little less pretty because of the 1/8 cup measurements on a couple of those ingredients, but it's still pretty simple. This one is also even lower calorie than the previous recipe, so there's plenty of room for a few apples or other small snacks, if I want.

What this all really means, is that instead of having to eat the same meal every single day, I can now make a different meal for each day.

Every couple weeks I go buy my ingredients, divvy them up into freezer bags, and dump them in the freezer. Then each day I eat the contents of one of the bags. It's been OK, but it'd be nice to add some variety.

And now I can! When I divvy up the foods next time, I'll be able to put different ingredients into each bag, and still be confident that they'll contain everything I need for the day. Of course, not everything will be mixed in at once. Only the veggies will be frozen; the rest will be opened for each meal.

I'm very excited. I can't wait to add more foods to my growing database of available items, and to construct more meals for myself.

If anyone has any healthy foods to suggest, let me know so I can add them in, and start eating them! In theory, this spreadsheet could balance even unhealthy foods into a nutritionally complete meal, but I'm not really interested in trying to shoe-horn unhealthy foods into my diet.

No comments:

Post a Comment