How To Compare Two Columns In Google Sheets [Easy Methods]

Written by Abid Akon

Here's what we'll cover:

Anyone inputting data into a worksheet is bound to make mistakes at some point, especially when inputting large sets of data. 

This technique is used to identify differences, similarities, duplicates between rows or cells in a column. It is very easy and quick to do, and it is sure to produce accurate results.

For the tutorial, we will be using a Google sheet consisting of two columns. Column A represents Items bought In March while Column B represents the Items bought in April. We compare with them in different way.

1 How To Compare Two Columns In Google Sheets

How to Compare Two Columns for Exact Row Matches.

This is the fastest and easiest way. It is also called cell-by-cell comparison. Your google sheet needs to point out which row has the exact or diverse data in a column and display the results.

We would simply construct a fresh column for the results and show TRUE if the set of data in the cell match and FALSE if they don’t match.

The formula used for comparing the columns is:

=A2=B2

When this formula is used, it produces a result of either true or false in Column C to show if the two columns match or not.

This technique is done in brief and quick steps.

Step 1: Input the formula above =A2=B2 in the function fx tab.

Step 2: Click Enter.

2 How To Compare Two Columns In Google Sheets

Step 3: A TRUE or FALSE statement is displayed in column C for results.

3 How To Compare Two Columns In Google Sheets

Step 4: Click on the other rows in column B. The effects of comparing columns A and B will be displayed in column C.

4 How To Compare Two Columns In Google Sheets

How to Compare Two Columns and Show Meaningful Text.

This technique is used when you are not the only person who is working on that particular google sheets. A third party viewing your worksheet might not comprehend what True or False means on the Google sheet. 

This is where you provide more explanation of the outcomes in column C. For example, instead of displaying True Or False, you can replace them with MATCH for row items that match and NOT MATCHING for row data that do not match.

We would utilize the formula: =IF(A2=B2,”Matching,Not Matching”)

Step 1: Input the formula =IF(A2=B2, “Matching,Not Matching”).in the formula in the function section at the top of the google sheets.

Step 2: Click Enter on your keyboard.

5 How To Compare Two Columns In Google Sheets

Step 3: The TRUE or FALSE statement is now replaced with MATCHING or NOT MATCHING as the results of the similarities between the second rows in column A and column B.

Step 4: Click on the other rows in column B. The outcomes of comparing the two columns will be displayed as MATCHING or NOT matching in column C.

6 How To Compare Two Columns In Google Sheets

How To Compare Two Columns to Find Matching Data.

The previous topics provided steps mainly on how to find out if the data in the cells in the columns are matching or not and if you want to compare two columns and find out which data in column A are repeated in column B and vice versa. 

This technique is used to check for duplicates in a given set of data. Here, we use Conditional Formatting to find duplicate data in your google sheets. Conditional Formatting is a method used to format cells in your worksheet based on a set condition. It is done in the steps listed below.

Step 1: Click Format on the tab section.

Step 2: From the list of options, select Conditional Formatting.

7 How To Compare Two Columns In Google Sheets

Step 3: A conditional formatting rules sidebar is displayed on the right-hand side of the google sheets.

8 How To Compare Two Columns In Google Sheets

Step 4: Type in the range of cells you want to apply the formatting on, in the box below Apply to range as shown below. In this example, we want to see the highlights of column A only. So we type A2:A12.

9 How To Compare Two Columns In Google Sheets

Step 5: Under the format rules tab, Format Cells If, select the arrow.

Step 6: Click on Custom Formula is on the menu.

10 How To Compare Two Columns In Google Sheets

Step 7: Enter your custom formula there. The formula is =COUNTIF($A$2:$A$10, B2)>0. Click on Done.

11 How To Compare Two Columns In Google Sheets

You would see all matching data present in the two columns highlighted with a default color. The next topic will explain how we can change the default highlight color to the color of your choice.

12 How To Compare Two Columns In Google Sheets

How To Compare Two Columns and Highlight Matching Rows.

If instead of displaying results in a separate column, you would rather have rows with matching data, highlighted in your color of choice, then you can perform Conditional Formatting.

Step 1: Click Format from the tab section.

Step 2: Click on the Conditional Formatting section.

13 How To Compare Two Columns In Google Sheets

Step 3: The conditional formatting rules section opens at the right-hand side of the google sheets.

14 How To Compare Two Columns In Google Sheets

Step 4: Input the range of cells in the column you want to be compared under Apply to range. We input A2:B10.

15 How To Compare Two Columns In Google Sheets

Step 5: In the Format rules section, ” Format cells if”, click on it.

Step 6: From the menu that is displayed, Click on Custom Formula is.

16 How To Compare Two Columns In Google Sheets

Step 7: Input Value or Custom formula: =$A2=$B2.

17 How To Compare Two Columns In Google Sheets

Step 8: Click on Formatting style.

Step 9: Select the Fill Color Icon. Pick the color you want to use. The selected color shows matching cells or rows.

19 How To Compare Two Columns In Google Sheets

I chose Red for the highlights for the matching rows or cells.

20 How To Compare Two Columns In Google Sheets

Step 10: Click on Done.

You would notice all matching cells in the two columns are highlighted in the color picked.

21 How To Compare Two Columns In Google Sheets

NOTE: In case you want to only highlight rows or cells that DO NOT match. You would change the formula used in Step 7 to =$A2<>$B2.

22 How To Compare Two Columns In Google Sheets

If you followed the steps correctly, the rows of data in each column that don’t match would be highlighted in the color picked as shown below:

23 How To Compare Two Columns In Google Sheets

How To Compare Two Columns and Find Missing Data.

This technique is used to find data present in column B but not in column A and vice versa.

It is easily done with the previous steps taken in Topic 4 except step 7 has a different formula.

Step 1: Click Format from the tab section.

Step 2: Select the Conditional Formatting section.

24 How To Compare Two Columns In Google Sheets

Step 3: The conditional formatting rules section opens at the right-hand side of the google sheets.

25 How To Compare Two Columns In Google Sheets

Step 4: Under Apply to range, input the range of cells in the column you want to be compared. We input A2:B10.

26 How To Compare Two Columns In Google Sheets

Step 5: In the Format rules section, ” Format cells if”, click on it.

Step 6: From the menu that is displayed, Select Custom Formula is.

27 How To Compare Two Columns In Google Sheets

Step 7: Input the custom value as =COUNTIF($A$2:$A$10, B2)=0.

This formula shows the number of occurrences of data in column B present in column A.

28 How To Compare Two Columns In Google Sheets

Step 8: Click on the Formatting style

Step 9: Click on the Fill Color Icon. Select the color you want to use. The selected color shows matching cells or rows.

29 How To Compare Two Columns In Google Sheets

We picked the Purple color to emphasize the missing rows in the two columns.

30 How To Compare Two Columns In Google Sheets

Step 10: Click on Done. The rows of data in column A that are missing in B are highlighted and vice versa.

31 How To Compare Two Columns In Google Sheets

Final Thoughts:

This guide was made to help people who find this tool in Google sheets difficult to operate and understand. 

These techniques are very useful when comparing long and large sets of data in cells and columns. We hope this tutorial is helpful. Thank you. 

Abid Akon

Abid Akon

I am a tech content writer. I really love to talk about different Modern Technology. It is very important that people know how to fix their tech related problem. That’s why I am writing articles to share my tech knowledge with you.

Related Articles

MD Abid Akon

Abid Akon

Hi, I am Abid. I really love to talk about different Modern Technology. It is very important that people know how to fix their tech related problem. That’s why I’ve created this website to share my technology keeping knowledge with you. Welcome to ”abidakon.com”

Abid Akon

My Personal Favorites
YouTube Channel