Calorie Tracking with Spreadsheets: Automating Recipe Calories

  • Thread starter Thread starter FrogPad
  • Start date Start date
  • Tags Tags
    Calories Tracking
AI Thread Summary
To automate the process of filling in calorie values for ingredients in a recipe spreadsheet, the VLOOKUP function is recommended. This function allows users to search for an ingredient in one column and return corresponding values, such as calories, from another column. The discussion highlights the need for a structured database of grocery items with nutritional information, which can be referenced in recipe entries. By using VLOOKUP, users can efficiently manage their recipes without manually entering data, streamlining the process of calculating total nutritional values for dishes like a banana shake. The approach is practical for those who prefer a simple solution over developing a full program.
FrogPad
Messages
801
Reaction score
0
Lets say I have the following spreadsheet.

Code:
     A              B            C            D            E
1   Ingredient  Calories    Protein     Recipe     Calories
2   Banana      100         1             =A2        ?

Now what I want to do is let's say I click on cell D2 and type "=A2" (without quotes of course). What happens is that D2 would then equal "Banana". How could I automatically make E2 fill in the appropriate amount of calories for banana?

I hope the way I worded this question makes sense.
 
Computer science news on Phys.org
hmmmmm... "=B2" but why would you want to have the same value twice??
 
You probably want to use the VLOOKUP function. This function searches for a match (exact or range compare) in one column, then returns a value correspoding to the same row in another column.
 
Anttech said:
hmmmmm... "=B2" but why would you want to have the same value twice??

I want it to be automated.

I want a "database" of different grocery items with some stats attached to them. For example,

Code:
Item       Calories   Protein   Carbohydrates   Fat
Soy Milk   100        6          9                     3
Banana    110        1          32                    0
Chicken    120        24        0                     0

Then I want another "database" of recipes. Each recipe will consist of items taken from the grocery list. So, for example if I wanted to create a recipe item such as a banana shake I would just click under recipe, and then in the items list I would add the items by typing =XX where XX is the cell that I clicked on with the recipe name.

Code:
Recipe                  Calories    Protein   Carbohydrates  Fat
Banana Shake

Soy Milk                100        6          9                     3
Soy Milk                100        6          9                     3
Banana                 110        1          32                    0

Total                    310        13        50                    6

I'm doing it this way because I don't have the time to put together a "real" program to do this. Hopefully this will suite my needs. It's going to be dirty, but oh well :)

Jeff Reid said:
You probably want to use the VLOOKUP function. This function searches for a match (exact or range compare) in one column, then returns a value correspoding to the same row in another column.
Thank you! Thank you! Thank you!

That's exactly what I wanted. Mercy.
 
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...
Back
Top