Link to home
Start Free TrialLog in
Avatar of Dave Kong
Dave KongFlag for United States of America

asked on

Excel 2010: How can I automatically adjust cell values based on the content of other cells? (follow up to #28590569)

In ID #28590569, an Excel workbook (food log) was modified to allow the quick entry of data by selecting food item names from a dropdown list populated by a master data worksheet. Selecting a name from the list enters that name and populates adjacent cells automatically with the associated values from the master list (protein, carbs, fats, total calories and serving size).

Now that that is working beautifully, I want to automatically compare the total serving size entered by the above process to the actual serving size listed entered in column A.  If the numbers are different, the percentage difference in the portions needs to be calculated and then applied to the numbers for protein, carbs, fats and total calories, so they are adjusted to reflect the actual serving size.
Food-Log-December-2014.xlsm
Avatar of Mike McCracken
Mike McCracken

Basic idea would be

[Protein Value] * [ColumnA] / [ServingSizeValue]

mlmcc
You need an IF statement for the comparison and then, use the suggestion from above.
Why is an if required?  If they are the same the multiplication will be by 1

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dave Kong

ASKER

Gowflow:

Thank you!  I am on a deadline but will check out the file later today.

Dave
Gowflow!

It's incredible!  It works beautifully.  When you enter a new item, if you fill out the actual portion first it just does the calculation.  This is even better than I had imagined.  THANK YOU!

Where do we go from here?  Do I need to open another question for you to set up the base sheet as you had suggested?

Dave
yes please as this is a total different issue altogether. PLease post a copy of the address of the new question in here if you need my help. as just the ID (and the wrong one will not help !!! :)

gowflow
Will do later today.  Thanks!

Dave
Pls If you need my help just wait for a sign as I will be off most of the day on Sat.
Tks
gowflow
You deserve a day off!  Have a great time!

Dave
Sorry for the delay had to take my son to ski for the weekend !!! :)
back to biz

gowflow
Gowflow has done it again!  The actual portion size is entered, the food item is selected, and the corresponding macronutrient values automatically calculate to match the portion size.  The size can be changed and the values recalculated - very flexible.  Another super job!
Tks for the very nice appreciation and comment.
gowflow