Consulting

Results 1 to 2 of 2

Thread: Conditional If-then help

  1. #1
    VBAX Newbie
    Joined
    Mar 2006
    Posts
    1
    Location

    Conditional If-then help

    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!

  2. #2
    VBAX Regular
    Joined
    Mar 2006
    Posts
    44
    Location

    VLOOKUP

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •