Monday, February 11, 2008

Nutrition calculator for Microsoft Excel or Open Office Spreadsheet

Have you ever wondered what was in the food you prepared? While there are nutrition facts on all food packages that we get from the grocery store, once we mix everything together, it's a lot of trouble to know what you're eating. I created a tool which makes this process easy (note: this tool includes database of around 7000 food items!)


First, the requirements. To use this, you should have Microsoft Excel or Open Office. If you have one of those programs or some other program which does the same job, then you can download the file. The file is available at http://www.michaelnehring.com/CalculateTable.xls. And the license: the food database was published by the USDA and you can get it yourself from http://www.ars.usda.gov/Services/docs.htm?docid=10093. This file was provided for free, and being a publication of the United States Government, it is not under any copyright. My file provides an alternative format to the provided data as well as an original tool for calculating the nutritional content of multiple foods mixed together. However, the tool is relatively simple and thus I also claim not copyright to the parts of the file that I myself created. Of course, I am to be held absolutely free of any liability for anything that happens with this tool. Enjoy!

And now how to use the tool. When you open the file, you will see a workbook with two spreadsheets, one named "data" and one named "calculator". The "data" table contains all the nutritional information from the USDA database. If you scroll to the right you can see all the different values that are stored there (water content, vitamins, calories, etc). All values in this table are for 100 grams of food. This is a big database and you want to be able to search in it. One way to search is with the standard search tool (Edit|Find or Ctrl+F in Excel). However, that may prove to be somewhat limited. For a better search method, you can filter the table. To filter the table click the "Data" menu, selec the "Filter" sub-menu and if "Auto-Filter" is not already checked, then check it. Now scroll to the top of the table. Each of the header items will have an down-arrow next to it. Click the down-arrow next to "Shrt_Desc". Select the 3rd item, "custom...". Now you can filter the table as you please based on the item description. For example, we can look for peppers. Select "contains" instead of "equals" and type in "pepper". Click "OK". Now you see only the items which have the word "pepper" in the description.

Now to use the calculator. You will need to copy the nutrition data from the table to the calculator. First find the food item that you wish to add. Once you found it, you need to highlight the entire row. You do this by clicking the absolute leftmost column in the row you wish to highlight. This row will contain a number between 1 and 8000, which is the row number (this is column before column A. This column has no name!). Once you have selected it, press Ctrl+C or select Edit|Copy. Now go over to the Calculator sheet. Select the row where you wish to paste the item (a row between 2 and 27) and hit Ctrl+V or select Edit|Paste. The item will now be pasted. Note: by default, there are two items in the table (peppers and chicken breast). These can be removed by selecting the row and hitting the delete key. Once you have pasted the item, select the "Amount" column in the row that you just pasted and enter the number of grams that you wish to add. Once you have entered the value, hit the enter key. Now you have added an item.

This is all you need to know to opperate the tables. Now you need to read the results.

At the bottom you should look at rows 28, 29, and 30. Row 28 contains the sum of all the nutritional entries listed there, weighted based on the number of grams you entered per item. Row 29 converts those numbers in the RDA-percentages (percent daily values are based on a 2000 calorie diet. Your daily values may be higher or lower, depending on your calorie needs). Row 30 shows how much of the nutrients you would get if you are 2000 calories worth of this item. For example, if the items you entered have only 500 calories and 40% of the RDA for calcium, then if you ate 2000 calories worth of this food, you would get 160% of your RDA for calcium. Row 30 is very useful in evaluating the nutritional goodness of what you are looking at. You want to keep values like sodium, fat, saturated fat, and cholesterol under 100% and vitamins, fiber and minerals above 100%. This will help you have a more balanced diet.

Enjoy!

No comments: