Add a fourth column D with the following formula. I assume you have column headers, with data starting in row 2. Put this formula in D2 and fill down:

Formula: copy to clipboard
=IF(A2=B2,"Match","No match")


Then sort on columns A:D using D as the key.