+ Reply to Thread
Results 1 to 4 of 4

Help with drop down list populating mulitple cells, that will react to other variables

  1. #1
    Registered User
    Join Date
    08-29-2013
    Location
    Warren, Ohio, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Help with drop down list populating mulitple cells, that will react to other variables

    Hey everyone, I'm new to this, so be gentle. I have no idea what i'm doing but I've been reading forums and watching YouTube videos for weeks and have made minimal head way.

    I'm designing my own workbook that will allow people to build their own diets. I am have difficulty in almost every field. First things first, I have created a drop down list under "food items," which when selected I would like the proper values to populate the "protein," "carb," "fat," "fiber," etc... fields respectively. BUT, in front of those cells, there is an "amount" cell that you would fill the the amount of say, eggs, you ate. Fully pictured: You ate 4 eggs, when you drop down the food time list and select eggs, the fat, carbs, protein, fiber, leucine, and total calories fields all fill with their proper values. Then when you put the "4" in the "amount" cell, the values all multiply by that value.

    Thanks for any help, and if you can point on where to actually LEARN this instead of just doing it for me would be awesome. But i have seen a few threads on here where the helpers just seem to do it for the people themselves. THANKS A MILLION!

    -Rocco
    Attached Files Attached Files

  2. #2
    Forum Contributor codeslizer's Avatar
    Join Date
    05-28-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003 - 2010
    Posts
    245

    Re: Help with drop down list populating mulitple cells, that will react to other variables

    Hi Rocco, a very warm welcome to the forum!

    I went through your work file. Are you trying to get the details based on the selected food item? Details like unit, fat, carbs, proteins, leucine and stuffs? If this is what you're looking for, then VLOOKUP should be your first choice. This function actually performs a vertical lookup to which you pass 4 parameters that helps you locate what you're looking for..

    1. Lookup_Value - is the string that you're searching among a list of table containing the data.
    2. Table_Array - is the reference table from which you'll searching the string first and then corresponding details to that row if found.
    3. col_index_number - is the column which will contain the result which you desire to retrieve.
    4. range_lookup - is a boolean parameter that instructs the function about the type of search you're performing. An approximate or exact match..

    Please find your attached re-worked file of yours that shows the same application. Hope, this is what you're looking for.
    Attached Files Attached Files
    cOdEsLiZeR - Back after a long break.. Let's sLiZe some more cOdEs!!

  3. #3
    Registered User
    Join Date
    08-29-2013
    Location
    Warren, Ohio, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Help with drop down list populating mulitple cells, that will react to other variables

    You almost nailed it! I just had to make a couple adjustments to how the quantity effected the values, but you did a GREAT JOB! Now for my next question. Once that table and array are establish, it's not accepting value changes from the table. Can I do that? for example I want to change the value of olive oil to 1 in the fat column and the unit to (g), but it's keeping the fat unit at 14, so when I enter a number into the quantity field, it's multiplying by 14 not by 1. Also, how do I make it so the #VALUE! thing doesn't show up if don't fill in one of the drop down boxes? Say you only eat 2 or 3 food items in a meal, not 5 or 6 or however i have set up, I want it to still function without needing all the drop boxes used. Thanks again! Here, take a look.new diet builder.xlsx

    Quote Originally Posted by codeslizer View Post
    Hi Rocco, a very warm welcome to the forum!

    I went through your work file. Are you trying to get the details based on the selected food item? Details like unit, fat, carbs, proteins, leucine and stuffs? If this is what you're looking for, then VLOOKUP should be your first choice. This function actually performs a vertical lookup to which you pass 4 parameters that helps you locate what you're looking for..

    1. Lookup_Value - is the string that you're searching among a list of table containing the data.
    2. Table_Array - is the reference table from which you'll searching the string first and then corresponding details to that row if found.
    3. col_index_number - is the column which will contain the result which you desire to retrieve.
    4. range_lookup - is a boolean parameter that instructs the function about the type of search you're performing. An approximate or exact match..

    Please find your attached re-worked file of yours that shows the same application. Hope, this is what you're looking for.

  4. #4
    Forum Contributor codeslizer's Avatar
    Join Date
    05-28-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003 - 2010
    Posts
    245

    Re: Help with drop down list populating mulitple cells, that will react to other variables

    Hey buddy, that's because its not referring the table from the food chart sheet but from another file named new diet builder2.xlsx which is at your desktop. Just go to Formula > Name Manager and select FoodTable from the list you'll find the address of that. Change it to the right reference.

    Please Login or Register  to view this content.
    And if you wish to make your food list table dynamic so that you can add extra item entries later in future, you can use dynamic named ranges using OFFSET function in the RefersTo part when creating a named range. Following is the syntax on how you can create:

    Please Login or Register  to view this content.
    Say if you want to select table from A3:H74, but want the table to be flexible to A3:H75, A3:H76, and so on.

    reference : is the point from you start. Say A1.
    rows : is the number of rows you wish to jump from the reference. Say 2 to reach A3
    cols : is the number of columns you wish to jump from reference. Say 3 if you wish to start the table from D3.

    Please note, both rows and cols adds the number to one available for reference. Personally, I prefer setting reference from where I want the table to start and put 0 rows and 0 cols.

    [height] - is the field that makes it dynamic. I use COUNT() or COUNTA() function to get the count of filled cells whether numeric or non-numeric. I prefer COUNTA() as it gets the counts of every filled cells. The range for the function is provided vertically, i.e. by columns. It is basically a column with multiple rows.

    [width] - is the field that makes it dynamic. Here also we use the same COUNTA or COUNT function but only difference is range is usually the a single row but with multiple columns in it. For instance,

    Please Login or Register  to view this content.
    Here as we're sure that 8 columns will be there in the table. Please note, in your file you have an extra table below the food table ""Free" foods/condiments". For making the table dynamic you should not have anything after the table as the size grows downwards and towards right. So I usually prefer putting then on the top-left sides or above the table. Hope this helps!
    Last edited by codeslizer; 09-07-2013 at 12:35 AM.

+ 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. Replies: 7
    Last Post: 05-26-2013, 07:59 PM
  2. [SOLVED] Populating multiple cells from drop down list
    By RWickstead in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 04-11-2013, 02:56 AM
  3. [SOLVED] Populating a drop down list dependent on multiple matching variables
    By Sardaukar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-28-2013, 02:48 AM
  4. Replies: 8
    Last Post: 08-08-2012, 01:26 PM
  5. Populating cells with the result of a drop down list
    By Barking_Mad in forum Excel General
    Replies: 7
    Last Post: 09-20-2009, 02:58 AM

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