Konsume
Konsume

Reputation: 59

I need to compare 2 work sheets and update one worksheet with the info from another

I've been trying to compare 2 sheets and update one of the sheets with some info. I know about vlookup but I don't understand how it works.

Here is what I need to do:

  1. Sheets("Product") has many products on the A column (over 8,000)

    • I need to select all products 1 by 1 and try to find if there is an EXACT MATCH (LookAt:=xlWhole) on the Sheets("Parker List").
  2. If there is a match on the Sheets("Parker List") I need to take SOME of the values of the Sheets("Parker List") and put them into Sheets("Product")

  3. If there is no match, I need to go to the next number in line in sheets("Product")

The values switch are: From Sheets("Parker List") I need "B" and "S" and than put the infos in respectively "F" and "H" of the sheets("Product") ONLY if the products of sheets("Product") are found in Sheets("Parker List").

Upvotes: 0

Views: 763

Answers (1)

Guy Hodges
Guy Hodges

Reputation: 157

If for example the product name is in column A in both sheets, you could use something like this in column F of Sheets("Product") to get the appropiate value from column B of Sheets("Parker List") :

=IF(ISERROR(MATCH(A1,'Parker List'!A:A,0)),"",INDEX('Parker List'!B:B,MATCH(A1,'Parker List'!A:A,0)))

The key to this is to use 0 as the third optional argument of the MATCH function which will return an error value when a match is not made. ISERROR will detect this error and the IF function will perform the required calculations accordingly.

Upvotes: 2

Related Questions