Compare arrays

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm not sure if this is an array question or not so hopefully someone can
point me in the right direction if it's not.
I have a list(column) of part numbers on one worksheet that I want to
compare to a list on another sheet. If I find a match, I want to copy the
corresponding price (next column sheet 2) to the price column on sheet 1.
I tried =IF(A1='page2'!A1:A50, 'page2'!B1:B50,0) for cell B2. I was hoping
that if I got a match in the A column, it would output the corresponding
value from the B column.
Any suggestions would be appreciated.
 
If there will only be one entry on the second sheet, look into doing a
vlookup, it will find a value in a column and return the values from another
column.
 
If A1 of sheet1 has a part number; and A1:B4 has you list on Sheet2
The =VLOOKUP(A1,Sheet2!$A$1:$B$4,2) will do what you want.
However, I am taking 'part-number' to mean something like A1234
If they are real numbers (1234) you will need
=VLOOKUP(A1,Sheet2!$A$1:$B$4,2,FALSE)
to prevent Excel returning a near match (ie match 1234 with 1235 if 1234 is
missing in the list).

best wishes
 
Thank you, the FALSE did the trick.

Bernard Liengme said:
If A1 of sheet1 has a part number; and A1:B4 has you list on Sheet2
The =VLOOKUP(A1,Sheet2!$A$1:$B$4,2) will do what you want.
However, I am taking 'part-number' to mean something like A1234
If they are real numbers (1234) you will need
=VLOOKUP(A1,Sheet2!$A$1:$B$4,2,FALSE)
to prevent Excel returning a near match (ie match 1234 with 1235 if 1234 is
missing in the list).

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email
 
Back
Top