View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Storm Storm is offline
external usenet poster
 
Posts: 58
Default Use a code to populate a cell with a specific value

yes sir, there is a way.

=if(isblank(k5),"",vlookup(k5,Cost!$A$1:$B$16,2,FA LSE))

*where K5 is the cell where you put the code in.

-storm :)

"braveT" wrote:

It worked. I had tried the Vlookup before, but I did not have it formatted
correctly. Is there any way to hide the error message "#n/a" when I have not
entered the code yet?
Thanks for your help!

"Storm" wrote:

How about using a vlookup formula? Going with what you said you have 16
different codes with different cost and let's say this data is in a worksheet
that is named "Cost". And let's say the data you have for this worksheet
begins in A1. So you have data from A1:A16 for the codes and B1:B16 for the
cost.

=VLOOKUP(k5,Cost!$A$1:$B$16,2,FALSE)

"braveT" wrote:

I am using a spreadsheet to track print jobs. One of the things I track is
the type of paper used and the cost of each piece for each job. Each paper
stock is assigned a stock code and has a unique cost. I want to be able to
enter the code and have the cost of the paper automatically come up in the
next cell. I currently have 16 different codes and each one has a different
cost. For instance, I want to enter the code PS1 in cell K5 and want it to
put the cost associated with PS1 (.03) in cell L5. I have tried to use the IF
function, but you can only nest 7 in a cell (I think). Any ideas? Any help
would be appreciated. Thanks!