0

Trying to find a formula, I was told a vlookup would work best I'll try to describe this as well as possible.

Two excel files.

Excel sheet 1 has the PID in column K. Excel sheet 2 has the PID in column C and the computer name in column A.

I need the PID numbers of sheet 1 and 2 to match any identical ID numbers and if the ID numbers match, I need it to grab information only information from column A (computer name) on sheet 2 and place it on column A of sheet 1.

Sorry if this is confusing, ask if you need clarification.

1 Answer 1

1

VLOOKUP requires the columns to be in a specific order and for the data to be sorted, MATCH is much more flexible.

Assuming your data starts in Row 3 (both sheets), and ends in Row 10 in sheet 2, this formula should work:

=INDEX(Sheet2!A$3:A$10,MATCH(K3,Sheet2!C$3:C$10,0))

where:

1) "Sheet2!A$3:A$10" - this is the array of computer names

2) "MATCH(K3,Sheet2!C$3:C$10,0) " - this returns the row you need, for which

2.a) "K3" - is the PID from sheet one

2.b) "Sheet2!C$3:C$10" - is the array of PIDs in sheet 2 you need to find a match

2.c) "0" - tells it to find an exact match

The above will give you errors if there is no match, if you want to eliminate those, use this version:

=IFERROR(INDEX(Sheet2!A$3:A$10,MATCH(K4,Sheet2!C$3:C$10,0)),""), you can replace the "" at the end with any text you want to display, like

=IFERROR(INDEX(Sheet2!A$3:A$10,MATCH(K4,Sheet2!C$3:C$10,0)),"NOT FOUND")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .