View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default How do I attach a number to a cell with text to use in a formula?

Create a 2 column table with the code in the left column and the
correspsonding cost in the right column.

...........A..........B
1.....Code....Cost
2........X..........5
3........Y..........3
4........Z..........6

Let's assume your drop down list is in cell H1. From the list you select
code Y. To get the cost for code Y:

=SUMIF(A2:A4,H1,B2:B4)

Or

=VLOOKUP(H1,A2:B4,2,0)

--
Biff
Microsoft Excel MVP


"Glen" wrote in message
...
I am trying to make a spreadsheet to allow for pricing. I have a dropdown
box
in a cell with stock codes and I want to attach a cost to each code so I
only
have to click on the code for it to be included in a formula. How can I
have
the formula read a number(cost) from a text(stock code) cell?