lundi 29 février 2016

If statements combined with lookups and corresponding calculations

Ok, so I am wanting to create a spreadsheet that allows me to calculate food macros automatically once I input the food and serving size. I have a table that has the food list and then the corresponding, proteins, carbs, fats, cals and then the serving size. What I want to happen is once I provide the food and the serving size, a function will look up and food from the table and calculate the individual macros based on what corresponds to the correct food.

Basically, if the value I enter in A2 is found in H2, divide the serving size that corresponds to h2 by the serving size corresponding to a2 and then multiply it by the macro value corresponding to h2. I have attached a picture so to hopefully show what I am attempting to do. Thank you for any help you can provide!!!

enter image description here

Aucun commentaire:

Enregistrer un commentaire