ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I attach a number to a cell with text to use in a formula? (https://www.excelbanter.com/excel-discussion-misc-queries/224835-how-do-i-attach-number-cell-text-use-formula.html)

Glen

How do I attach a number to a cell with text to use in a formula?
 
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?

T. Valko

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?





All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com