+ Reply to Thread
Results 1 to 7 of 7

Trying to create a simple food database.

Hybrid View

xellero Trying to create a simple... 08-26-2014, 06:40 PM
mehmetcik Re: Trying to create a simple... 08-26-2014, 06:55 PM
newdoverman Re: Trying to create a simple... 08-26-2014, 07:17 PM
xellero Re: Trying to create a simple... 08-26-2014, 07:22 PM
xellero Re: Trying to create a simple... 08-26-2014, 07:18 PM
newdoverman Re: Trying to create a simple... 08-26-2014, 07:32 PM
newdoverman Re: Trying to create a simple... 08-26-2014, 08:57 PM
  1. #1
    Registered User
    Join Date
    08-26-2014
    Location
    Europe
    MS-Off Ver
    2013
    Posts
    4

    Trying to create a simple food database.

    Hello i want to create a food database as follows:

    Food Name Food Qty Calories Protein Carbs Fats
    Milk 0.1% Fat 100 g 31 3.2 4.5 0.1
    But in the Food Qty cell i must be able to select another value ex. 230 g and the calories and all other nutritional info would change. How can i do that? I just started learning Excel 2013.

    Thank you.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Trying to create a simple food database.

    The simplest method is to use two sheets or two areas within the same sheet.

    I will create a sample for you.

    I changed the cell where you entered 100g

    Entering numbers like that complicates everything.

    I entered 100 and created a custom format to show the g.

    right click on the cell

    select format cell
    select custom
    and enter 0.00 "g"
    Attached Files Attached Files
    Last edited by mehmetcik; 08-27-2014 at 03:24 PM. Reason: Wrong Sheet Attached

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Trying to create a simple food database.

    This is a little different approach. The original data is on the DATA worksheet and on the MAIN worksheet you fill in the amount that you want and the rest is filled in.

    The basic formula used is:
    Formula: copy to clipboard
    =IF(A2="","",VLOOKUP($A2,Data!$A$2:$F$10,COLUMNS($A$1:C1),0)*$B2/Data!$B2)
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Registered User
    Join Date
    08-26-2014
    Location
    Europe
    MS-Off Ver
    2013
    Posts
    4

    Re: Trying to create a simple food database.

    Quote Originally Posted by newdoverman View Post
    This is a little different approach. The original data is on the DATA worksheet and on the MAIN worksheet you fill in the amount that you want and the rest is filled in.

    The basic formula used is:
    Formula: copy to clipboard
    =IF(A2="","",VLOOKUP($A2,Data!$A$2:$F$10,COLUMNS($A$1:C1),0)*$B2/Data!$B2)
    Yes, Thank you very much newdoverman that is exactly what i needed. Now i must figure it out how to replicate it and create it myself.

  5. #5
    Registered User
    Join Date
    08-26-2014
    Location
    Europe
    MS-Off Ver
    2013
    Posts
    4

    Re: Trying to create a simple food database.

    Thank you i really appreciate it but now there are 2 Food Qty Cells. and when i change the value in the first one, it changes only the second Food Qty cell.

    For example i change the Food Qty cell to 90 g, It must become like this:

    Food Name Food Qty Calories Protein Carbs Carbs
    Milk 0.1% Fat 90 g 27.9 (31 * 90 / 100) 2.88 (3.2 * 90 / 100) 4.05 (4.5 * 90 / 100) 0.09 (0.1 * 90 /100)

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Trying to create a simple food database.

    I made a slight mistake in the basic formula. It should have $A2 at the start like this:

    Formula: copy to clipboard
    =IF($A2="","",VLOOKUP($A2,Data!$A$2:$F$10,COLUMNS($A$1:C1),0)*$B2/Data!$B2)


    The formula is entered in C2 on the MAIN worksheet and copied across and down as far as you want. The range for Data!$a$2:$f$10 has to be extended to match the length of the data on the DATA worksheet.

    It isn't a complicated formula. It is a basic VLOOKUP and uses the COLUMNS function to determine which column from which to return values.

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Trying to create a simple food database.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Simple Database
    By Jack40 in forum Access Tables & Databases
    Replies: 4
    Last Post: 09-27-2012, 05:31 PM
  2. Trying to create a simple quoting database
    By sprattuk in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 10-07-2010, 08:41 AM
  3. Assistance to create a food intolerance spreadsheet
    By iamstellaman in forum Excel General
    Replies: 2
    Last Post: 05-26-2008, 01:15 PM
  4. Simple database
    By Tomos in forum Excel General
    Replies: 2
    Last Post: 08-25-2005, 08:30 AM
  5. Posting data from a simple form to a simple database
    By clacka in forum Excel General
    Replies: 0
    Last Post: 01-30-2005, 04:37 PM

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