Excel Problem

  • Thread starter FrogPad
  • Start date
  • #1
809
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 lets 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.
 

Answers and Replies

  • #2
221
0
hmmmmm.... "=B2" but why would you want to have the same value twice??
 
  • #3
rcgldr
Homework Helper
8,715
539
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.
 
  • #4
809
0
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.
 

Related Threads on Excel Problem

  • Last Post
Replies
12
Views
3K
  • Last Post
Replies
5
Views
11K
  • Last Post
Replies
3
Views
8K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
4
Views
885
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
4
Views
3K
Top