ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   comparing 2 columns for matches (https://www.excelbanter.com/excel-discussion-misc-queries/202651-comparing-2-columns-matches.html)

Burt

comparing 2 columns for matches
 
Hi, I have 2 columns with data (lets say A and C). I want to (in another
column, say B) put a formula in that finds if a value in column A and looks
to see if there is a match in column C (not necessarily on same row). If
there is a match I want to input a value which exists in a 4th column in the
same row as the matched value in column C. e.g:

Col A Col B (formula here) Col C Col D
dog No match bear xxx
cat No match mouse vvv
mouse vvv lion xxx

So...if a value from column A exists in Col C (e.g. mouse) then in column
B i want to extract the value from col D (e.g. vvv), otherwise say 'no
match'. So both two and three.

Is this possible?




ND Pard

comparing 2 columns for matches
 
Assuming in your example the data is in cells A1 through D3, the following
formula should work:

=if(iserr(vLookUp($A1,$C$1:$D$3,2,false)),"No
Match",vLookUp($A1,$C$1:$D$3,2,False))

Good Luck

"Burt" wrote:

Hi, I have 2 columns with data (lets say A and C). I want to (in another
column, say B) put a formula in that finds if a value in column A and looks
to see if there is a match in column C (not necessarily on same row). If
there is a match I want to input a value which exists in a 4th column in the
same row as the matched value in column C. e.g:

Col A Col B (formula here) Col C Col D
dog No match bear xxx
cat No match mouse vvv
mouse vvv lion xxx

So...if a value from column A exists in Col C (e.g. mouse) then in column
B i want to extract the value from col D (e.g. vvv), otherwise say 'no
match'. So both two and three.

Is this possible?




Burt

comparing 2 columns for matches
 
Couldn't figure out why it wouldnt work, but as soon as I had changed it to
'iserror' then it worked perfectly.

Thanks for the formula

Cheers,

"ND Pard" wrote:

Assuming in your example the data is in cells A1 through D3, the following
formula should work:

=if(iserr(vLookUp($A1,$C$1:$D$3,2,false)),"No
Match",vLookUp($A1,$C$1:$D$3,2,False))

Good Luck

"Burt" wrote:

Hi, I have 2 columns with data (lets say A and C). I want to (in another
column, say B) put a formula in that finds if a value in column A and looks
to see if there is a match in column C (not necessarily on same row). If
there is a match I want to input a value which exists in a 4th column in the
same row as the matched value in column C. e.g:

Col A Col B (formula here) Col C Col D
dog No match bear xxx
cat No match mouse vvv
mouse vvv lion xxx

So...if a value from column A exists in Col C (e.g. mouse) then in column
B i want to extract the value from col D (e.g. vvv), otherwise say 'no
match'. So both two and three.

Is this possible?





All times are GMT +1. The time now is 10:51 AM.

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