ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Comparing 2 columns from 2 different Worksheet and Returing Value of a 3rd column (https://www.excelbanter.com/excel-worksheet-functions/446842-comparing-2-columns-2-different-worksheet-returing-value-3rd-column.html)

sourcing

Comparing 2 columns from 2 different Worksheet and Returing Value of a 3rd column
 
I have 2 different worksheets, I need to compare Column D of worksheet 1 to the range of column A of worksheet 2. If the value in Column D worksheet 1 will match the value in the range of column A worksheet 2 I need to get the value in Column O of worksheet 2.

e.g.
Compare value of worksheet 1 column D row 2 to worksheet 2 column A rows 2 - 1000. If worksheet 1 D2 appears anywhere in worksheet 2 A1 to A1000 I want to return the text/value in worksheet 2 column O.

If worksheet 1 D2 = worksheet 2 A347 I want to return the text/value in worksheet 2 O347. The repeat this from D2 to D500

zvkmpw

Comparing 2 columns from 2 different Worksheet and Returing Valueof a 3rd column
 
I have 2 different worksheets, I need to compare Column D of worksheet 1
to the range of column A of worksheet 2.

Compare value of worksheet 1 column D row 2 to worksheet 2 column A rows
2 - 1000. If worksheet 1 D2 appears anywhere in worksheet 2 A1 to A1000
I want to return the text/value in worksheet 2 column O.

If worksheet 1 D2 = worksheet 2 A347 I want to return the text/value in
worksheet 2 O347. The repeat this from D2 to D500


One way is to put this in Sheet1!B2 and copy down as far as needed:
=IF(ISERROR(1/(VLOOKUP(D2,Sheet2!A:O,15,FALSE)<"")),"",
VLOOKUP(D2,Sheet2!A:O,15,FALSE))
The ISERROR(...) part is meant to return an empty string in two cases:
- The value searched for is absent from Sheet2 column A.
- It's present, but the corresponding "column O" cell is empty.

Jay07

Quote:

Originally Posted by sourcing (Post 1604603)
I have 2 different worksheets, I need to compare Column D of worksheet 1 to the range of column A of worksheet 2. If the value in Column D worksheet 1 will match the value in the range of column A worksheet 2 I need to get the value in Column O of worksheet 2.

e.g.
Compare value of worksheet 1 column D row 2 to worksheet 2 column A rows 2 - 1000. If worksheet 1 D2 appears anywhere in worksheet 2 A1 to A1000 I want to return the text/value in worksheet 2 column O.

If worksheet 1 D2 = worksheet 2 A347 I want to return the text/value in worksheet 2 O347. The repeat this from D2 to D500

If you move Column O to Column B in worksheet 2 then you could use a VLOOKUP to do this...

=VLOOKUP('Worksheet1'!D2,'Worksheet2'!$A$1:$B$1000 ,2,FALSE)


All times are GMT +1. The time now is 07:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com