ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   comparing two columns (https://www.excelbanter.com/excel-worksheet-functions/229515-comparing-two-columns.html)

JoeM[_3_]

comparing two columns
 
I have a number of ids in two columns and am trying to represent which ones
in the second column also appear in the first.

T. Valko

comparing two columns
 
One way...

Comparing column B to column A with the list in column A in the range
A1:A20.

=IF(COUNTIF(A$1:A$20,B1),"match","")

Copy down as needed.

--
Biff
Microsoft Excel MVP


"JoeM" wrote in message
...
I have a number of ids in two columns and am trying to represent which ones
in the second column also appear in the first.




Jacob Skaria

comparing two columns
 
Apply the formula in C1 which will check the value of B1 in A and return Y or N

=IF(COUNTIF(A:A,B1)0,"Y","N")
--
If this post helps click Yes
---------------
Jacob Skaria


"JoeM" wrote:

I have a number of ids in two columns and am trying to represent which ones
in the second column also appear in the first.


Glenn

comparing two columns
 
JoeM wrote:
I have a number of ids in two columns and am trying to represent which ones
in the second column also appear in the first.


Assuming your two columns are A and B, select column B and enter this for
conditional formatting:

=COUNTIF($A:$A,B1)0

Select the format you want to "represent" matches.

Harlan Grove[_2_]

comparing two columns
 
"T. Valko" wrote...
One way...


And the slow way . . .

Comparing column B to column A with the list in column A in the range
A1:A20.

=IF(COUNTIF(A$1:A$20,B1),"match","")


Bit faster to use

=IF(COUNT(MATCH(B1,A$1:A$20,0)),"match","")

or just

=MATCH(B1,A$1:A$20,0)

which would return a number when there's a match and #N/A when there
isn't.

T. Valko

comparing two columns
 
I'm bored too!

--
Biff
Microsoft Excel MVP


"Harlan Grove" wrote in message
...
"T. Valko" wrote...
One way...


And the slow way . . .

Comparing column B to column A with the list in column A in the range
A1:A20.

=IF(COUNTIF(A$1:A$20,B1),"match","")


Bit faster to use

=IF(COUNT(MATCH(B1,A$1:A$20,0)),"match","")

or just

=MATCH(B1,A$1:A$20,0)

which would return a number when there's a match and #N/A when there
isn't.





All times are GMT +1. The time now is 01:23 PM.

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