View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Debra Dalgleish Debra Dalgleish is offline
external usenet poster
 
Posts: 2,979
Default Drop Down List Creating Prices in adjoining box

You can wrap the VLookup formula with an IF formula. For example:

=IF(B2="","",VLOOKUP(B2,FoodTable,4,0))

Then, if cell B2 is empty, the formula cell will also appear empty.

jamesebailey72 wrote:
Thanks again!!! Next question, in this sheet I am having a running total for
the daily calorie intake. In the boxes that I have not yet selected an item,
the adjoing boxes that have the calorie, protein, etc show '#N/A'. How do I
have this stay blank when nothing is selected and how do I not let this
affect my running total?

"Debra Dalgleish" wrote:


The tutorial has 2 columns in the lookup table, and your lookup table
would have 5 columns. In the VLookup formula, you'd refer to the column
that has the data you want.

For example, if Protein is in the 4th column of the lookup table, you'd
use a 4 in the VLookup formula.

=VLOOKUP(B2,FoodTable,4,0)

In the above formula, the food item that you selected is in cell B2, and
the lookup table has been named FoodTable.

jamesebailey72 wrote:

I am creating a list with with adjoining cells that show the food item,
calories, carbs, protein and fat intake. I have tried adapting the tutorial
you have but no luck. Please help!!!

"Debra Dalgleish" wrote:



There's a sample file on my web site that uses Data Validation and
VLookup to complete an order form. You could use the same technique for
your worksheet:

http://www.contextures.com/xlOrderForm01.html



--
Debra Dalgleish
Contextures
www.contextures.com/tiptech.html
Blog: http://blog.contextures.com





--
Debra Dalgleish
Contextures
www.contextures.com/tiptech.html
Blog: http://blog.contextures.com