Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Use a code to populate a cell with a specific value

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!


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 301
Default Use a code to populate a cell with a specific value

Set up a little table with PS1 in one cell, .03 in the next cell to the
right, then PS2 & .073 in the next row, etc, then use
=VLOOKUP(K5,x,2,FALSE)
where x is the reference to the 2 columns x ?rows, like G1:H16

"braveT" wrote in message
...
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!




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Use a code to populate a cell with a specific value

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!


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Use a code to populate a cell with a specific value

Create a 2 column table. The left column will be the codes and the right
column will be the corresponding price.

Assume that table is in the range A1:B16

Then you can use one of these formulas to get the price:

K5 = PS1

=SUMIF(A1:A16,K15,B1:B16)

=IF(K15="",0,VLOOKUP(K15,A1:B16,2,0))

=IF(K15="",0,INDEX(B1:B16,MATCH(K15,A1:A16,0)))

Biff

"braveT" wrote in message
...
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!




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Use a code to populate a cell with a specific value

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!




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code to populate 1000's of cells? [email protected] Excel Discussion (Misc queries) 14 March 31st 06 06:12 AM
Cells populate on specific dates JD MPLS Excel Worksheet Functions 1 February 9th 06 03:12 PM
When I select from drop down menu I would like the next column to populate a specific cost. [email protected] Excel Worksheet Functions 5 January 9th 06 11:23 PM
HOW ?Excel chart auto insert /populate a code based on date MikeR-Oz New Users to Excel 6 December 22nd 05 12:16 PM
how to color code a row of cells based on a specific cell value Parker1333 New Users to Excel 1 February 2nd 05 08:01 AM


All times are GMT +1. The time now is 02:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"