PDA

View Full Version : Conditional If-then help



spudman
03-09-2006, 06:03 PM
Here is my dilema...

I have a huge list of data, which consists of different products and details. Each product originiates from a specific/different factory. There are many products produced at a factory, (there are a total of 7 factories). However, the name of the factory is not included in the spreadsheet. What would be the best way for adding the factory name in a new column? I thought about setting up an if-then, but there are about 200 products.... how could I write a marco that I could run that would do this? Thanks for your help!

smc2911
03-09-2006, 06:58 PM
If you have a table of products and factories, you can use VLOOKUP to add a factory column to your data. So, if the product was in column A and the data started in row 2 and your table of product and factory info was in columns B and C of worksheet 2 (say in the range B2:C202 with the B1 and C1 containing the labels "Product" and "Factory"), you could use something like this for your new factory column:

=VLOOKUP(A2, Sheet2!B2:C202, 2, FALSE)

Sean.