
Originally Posted by
sk1
Ok, after removing the '$' characters from the formulas (what are they for?) I can now see how it works so I can replicate it for further items. But I'm unsure why the formulas need to define a table range (e.g. A8:E16).
B2 for example (=F2*VLOOKUP(A2,A8:E16,2)/100): 'F2' is to reference the gram value, 'A8' and '2' are to reference the total calories value; I'm unsure why 'A2' and 'E16' are needed in the formula.
I should have no problems creating the database now anyway, but it might be useful to know a little more about how it works.
Cheers again
Hi The $ characters are there to avoid problems if you were to copy the formula elsewhere. Without them, as you now have it, and if you were to copy the formula to say row 3 you'd find that they would no longer address the same table. As it happens and provided you never copy it elsewhere you'll be OK. The $ signs are there to make cell references Absolute references rather than Relative references. It's worth examining the difference between the two a little more since they will catch you out in other circumstances.
I guess you've moved the word 'Oats' to A2. No problem with that because the formula has been changed to use A2. The VLOOKUP() function uses whatever is in A2 to identify the correct row to use in the Table of Calorie values.
Actually I realise there's a potential problem since the VLOOKUP() element in the formulae don't contain the 4th element "False". Please substitute the following
HTH
Bookmarks