How to compare 2 different columns in Google Sheet
<p>I have two columns I'd like to compare data in. The first column has about 50 rows, whereas the second column has 200 rows. </p>

<p>I would like to be able to tell if any cell in the first column matches up with a value in the second column.</p>

<p>I first tried this with the QUERY() function</p>

<pre><code>=QUERY(A12:B, "Select A where A = B")
</code></pre>

<p>but this didn't seem to work, I got a circular dependency error.</p>

<p>I then tried the array function.</p>

<pre><code>=ARRAYFORMULA(if(A12:A=B12:B,"REMOVE_ME", "DON'T REMOVE ME"))
</code></pre>

<p>but this was outputting incorrect values. Is there an easier way to do this or am I missing something?</p>

<p>Here is sample data: <a href="https://docs.google.com/spreadsheets/d/1IVUksDc79uJPfe6_Yfkp-EBelzh-U3q1EIiYlguQoRw/edit?usp=sharing" rel="nofollow">https://docs.google.com/spreadsheets/d/1IVUksDc79uJPfe6_Yfkp-EBelzh-U3q1EIiYlguQoRw/edit?usp=sharing</a></p>

<p>The value 6 is given MATCH because there is a value 6 somewhere in Column B. </p>