+ Reply to Thread
Results 1 to 4 of 4

Quick Nutrition Guide

Hybrid View

  1. #1
    Registered User
    Join Date
    01-24-2005
    Posts
    2

    Quick Nutrition Guide

    I am trying to set an existing spread sheet to fill in FAT CARB & PROTEIN Values after I type in the food name. I have 1 worksheet with the A column with the food name, B is fat, C is Carb and D is Protein. I have tried to use VLookup, but I know I am doing something wrong because the only answer I get is REF.

    How my actual document is set up:

    Worksheet 1
    "Food Chart"
    Column A = name of food
    Column B= Grams of fat
    Column C= Grams of Carb
    Column D= Grams of Protein

    Worksheet 2
    "Week 1"
    A2 is blank where I would input the name of the food
    B3 is blank where I would input the fat
    B4 is blank where I would input the Carb
    B5 is blank where I would input the Protein

    My goal is to put the food in A2, and have B3,B4, & B5 fill in automatically from the information on the "Food Chart" page. This pattern repeats itself for 5 foods in column A and 5 meals across per day. Then it repeats itself for 7 days a week, and that is per work sheet. I have 9 weeks set up this way.

    I am sure my explanation is as confused as I am right now, but any help is appreciated.
    Last edited by shema; 01-24-2005 at 02:20 PM.

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    To get your values in B3, B4 and B5 try these formulae:

    In B3 on Worksheet 2 type:
    =VLOOKUP(A$2,Sheet1!$A$2:$D$100,2,FALSE)

    In B4 type:
    =VLOOKUP(A$2,Sheet1!$A$2:$D$100,3,FALSE)

    and in B5 type:
    =VLOOKUP(A$2,Sheet1!$A$2:$D$100,4,FALSE)

    I don't follow how your data is spread out on Worksheet 2 so adjust the formulae accordingly and change the 100 value I used to whatever the last row number is in your range of data on Worksheet 1.

  3. #3
    Registered User
    Join Date
    01-24-2005
    Posts
    2
    Thank you, it worked, and I will be able to sleep at night...

    I do have one more question. How do I get the value in the B3,B4,B5 to equal 0 if I have not entered a food in A2? It is screwing up other formulae that I have set up. Right now, I entered "blank" into my food list, and put the numbers at 0,0,0 which has solved the problem, but I am sure there is a better way. Thank you very much for your help.
    Last edited by shema; 01-24-2005 at 04:51 PM.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    This will take care of that for you.

    Using the same examples I gave earlier:

    In B3 type: =IF(A$2="",0,VLOOKUP(A$2,Sheet1!$A$2:$D$100,2,FALSE))
    In B4 type: =IF(A$2="",0,VLOOKUP(A$2,Sheet1!$A$2:$D$100,3,FALSE))
    In B5 type: =IF(A$2="",0,VLOOKUP(A$2,Sheet1!$A$2:$D$100,4,FALSE))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1