Help with Formulas

mntraynum

New Member
Joined
Jun 18, 2018
Messages
8
Hello all,

I'm trying to create a spreadsheet that will help my wife and I calculate food macros based off a single drop down box. The drop down box will have a food item and I would like to auto populate all the calories, fats, carbs and protein based off the drop down selection. Here is a quick example.

I have a chart with all the food macro information in it beside the food item. I'm not sure what formula/s to use to get to auto populate the cells.
When I choose the Peanut Butter 1 serving from the drop down box, I want it to fill in the rest from the chart below.
Just a quick example... Thanks in advance for your help!
QtyCalorieCal From FatFatCarbsFiberNet CarbsProtein
Peanut Butter 1 serving
Peanut Butter 2 servings
itemQtyCaloriecal from fatfatCarbsFiberNet CarbsProtein
Peanut Butter 1 serving32g200190174318
Peanut Butter 2 servings64g4003803486216
Butter 1 tbsp1 tbsp100100110000
Butter 2 tbsp2 tbsp200200220000
<colgroup><col width="163" style="width: 122pt; mso-width-source: userset; mso-width-alt: 5961;"> <col width="78" style="width: 59pt; mso-width-source: userset; mso-width-alt: 2852;" span="8"> <tbody> </tbody>
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Something like this would do what you want, I think. I've put them out of order because otherwise it just looks like your table :) ...but it would work with a dropdown in a cell to show only the one you want on a single row.


Book1
ABCDEFGHI
1caloriecarbproteinfiber
2Butter 1 tbsp100000
3Peanut Butter 1 serving200483
4peanut butter 2 servings4008166
5
6
7
8itemQtyCaloriecal from fatfatCarbsFiberNet CarbsProtein
9Peanut Butter 1 serving32g200190174318
10Peanut Butter 2 servings64g4003803486216
11Butter 1 tbsp1 tbsp100100110000
12Butter 2 tbsp2 tbsp200200220000
Sheet1
Cell Formulas
RangeFormula
B2=VLOOKUP(A2,$A$9:$I$12,3,FALSE)
C2=VLOOKUP(A2,$A$9:$I$12,6,FALSE)
D2=VLOOKUP(A2,$A$9:$I$12,9,FALSE)
E2=VLOOKUP(A2,$A$9:$I$12,7,FALSE)


As you can see in line 3, vlookup is not case sensitive, but if you're using a dropdown list that shouldn't matter in this case.
 
Upvote 0
Thanks for the reply jproffer. Would this work on a blank sheet prior to selecting from the drop down?
 
Upvote 0
As long as you refer to the cell the dropdown will eventually fill, then yes. That cell would go in place of my cell A2 (first argument)
 
Upvote 0
I'm not sure what is wrong but this section of the formula is giving me an error. $A$9:$I$12 highlighted red
 
Upvote 0
Your formula only shows 9 columns (K through S) in your table, but you're wanting to return column 13. No can do :) .

It's Vlookup.
 
Upvote 0
Got it! Thanks again! Also, is there anyway to make the process quicker? Like do the entire column vs each individual cell?
 
Upvote 0
Now you kind of lost me. You want to return all the info for, say, "butter 1 tbsp" at one go instead of having 10 (or however many) Vlookup formulas to find each individual cell of information? I don't think so, and I don't think you would gain a lot of time even if you could.

You're only looking up one item from your list at a time, is that right? And 10 or so informational items for that food item?

Even if you have 1000s of food items in your list, it should only take milliseconds to find all your nut. information items for that food item after you select it.
 
Upvote 0

Forum statistics

Threads
1,214,575
Messages
6,120,334
Members
448,956
Latest member
Adamsxl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top