ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   compare data in two columns (https://www.excelbanter.com/excel-worksheet-functions/138664-compare-data-two-columns.html)

Kim

compare data in two columns
 
What is the correct formula to use to compare data in column A to see if
there is a match in column B. In column C, just return the value in column A
if there is a match anywhere in column B, otherwise leave blank.
Col A Col B Col C
1234 5555
4321 3457
5555 3241 5555
5241 2319
3457 5361 3457

I have tried Vlookup, If statements, and a few others, but can't seems to
get the correct format. Thank you.


Teethless mama

compare data in two columns
 
=IF(COUNTIF($B$1:$B$5,A1),A1,"")


"Kim" wrote:

What is the correct formula to use to compare data in column A to see if
there is a match in column B. In column C, just return the value in column A
if there is a match anywhere in column B, otherwise leave blank.
Col A Col B Col C
1234 5555
4321 3457
5555 3241 5555
5241 2319
3457 5361 3457

I have tried Vlookup, If statements, and a few others, but can't seems to
get the correct format. Thank you.


Kim

compare data in two columns
 
Thank you, teethless, it worked!


"Teethless mama" wrote:

=IF(COUNTIF($B$1:$B$5,A1),A1,"")


"Kim" wrote:

What is the correct formula to use to compare data in column A to see if
there is a match in column B. In column C, just return the value in column A
if there is a match anywhere in column B, otherwise leave blank.
Col A Col B Col C
1234 5555
4321 3457
5555 3241 5555
5241 2319
3457 5361 3457

I have tried Vlookup, If statements, and a few others, but can't seems to
get the correct format. Thank you.



All times are GMT +1. The time now is 02:34 PM.

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