Wondering how to use Google Sheets to compare two columns? I love how easy Google Sheets makes streamlining data, especially when I remember how complicated manual tasks used to be!
With the right formulas, Google Sheets automates the process, returning results almost instantaneously. My tutorial will show you how to compare two columns in Google Sheets with various methods.
This Article Covers:
How to Compare Two Cells for Matching Data
To ease you into things, the simplest comparison is checking whether two cells have the same value.
The formula Iโve used for this comparison is: โ=cell1=cell2โ
This formula will return โTRUEโ if the cells have the same data and โFALSEโ if they donโt. To check whether two cells are equal in Google Sheets:
- Select the cell you want the results to appear in (yellow arrow).
- Enter the formula (blue arrow):
- =first cell identifierย
- =second cell identifier.
In this case, Iโm comparing cell A2 with cell B2. This formula would be โ=A2=B2โ.

Note: You can also try to use the alternative function ISTEXT.
The Easiest Way to Compare Two Columns for Matches Across Rows
Letโs take things to the next level: comparing two columns for matches across entire rows.
Weโll use the same โ=cell1=cell2โ formula as last time, but weโll use two columns in the same row. Again, this formula will return โTRUEโ if the cells have the same data and โFALSEโ if they do not.
To compare cells for a match across rows:
- Select the top cell of the column you want the results to appear in (yellow arrow). In the example case, Iโve used C2.
- Enter the formula identified by the blue arrow:
- =first cell identifierย
- =second cell identifier.ย
In this case, Iโm comparing cells in the same row. Use A2 and B2 to make the formula โ=A2=B2โ.

3. Drag the square in the bottom-right corner of the comparison cell down to the last row youโre comparing. In this example, I want to compare rows through row 6. This will apply the formula to compare the cell in the first column with the second column in each row.
Comparing and Highlighting Matching Rows with Conditional Formatting
To highlight matching rows in Google Sheets using conditional formatting, you can follow these steps:
- Select the range by highlighting the cells to which youโll apply conditional formatting. In this case, youโd highlight Column A and Column B.
- In the drop-down menu, select Format > Conditional Formatting to set up a conditional formatting rule.
- In the conditional formatting window, select โFormat cells ifโ dropdown > โCustom formula is.โย
- Insert the following formula: =$A1=$B1. This will check whether cell A1โs value is equal to cell B1โs. You can make any cell adjustments to suit your requirements.ย
- Next, select any sort of formatting options you prefer, such as fill color, text color, etc.
- Click โDone.โ You should now see highlighted rows where numerical values in Column A and B match. You may need to adjust the formula and cell references to suit your aims.
Returning a Pre-Defined Value for Matches & Differences Between Two Columns
Using โTRUEโ and โFALSEโ for matches makes sense to the person who set up the formula.
However, it doesnโt provide context to people who donโt understand that formula. Instead of returning โTRUEโ or โFALSEโ, you can modify your formula to return different text
=IF(Cell1=Cell2,โTrue Replacement Textโ,โFalse Replacement Textโ)
The formula with the chosen values โSameโ for โTRUEโ and โDifferentโ for โFALSEโ will look like:
=IF(A2=B2,โSameโ,โDifferentโ)

To compare cells for a match across rows with redefined โTRUEโ and โFALSEโ values:
- Select the top cell in the comparison column. In this example, Iโve chosen Column C (yellow arrow).
- Enter the =IF(Cell1=Cell1,โTrue Replacement Textโ,โFalse Replacement Textโ) as the cell formula (blue arrow). In this example, I used =IF(A2=B2,โSameโ,โDifferentโ).
- Select the square in the bottom-right corner of the comparison cell and drag down to the last row youโre comparing (black arrow).
The โCompareโ column should now show whether the values for columns โAโ and โBโ are the same or different.
How to Make Conditional Comparisons Across Two Columns
When you compare two columns in Google Sheets, the results arenโt limited to โsameโ or โdifferent.โ You can also apply a conditional statement to compare Sheets cell by cell.
These comparisons can get fairly complex, so Iโm using a simple formula:ย
=IF(Conditional Statement (<, >, =, etc),”Cell 1 True Text”,”Cell 2 True Text”)
With the values filled in to return โShop 1โ or โShop 2โ as the less expensive option:
=IF(B2<C2,”Shop 1″,”Shop 2″)
To compare cells across rows with predefined conditional-response values:

- Select the top cell in the comparison column (yellow arrow).
- Enter the =IF(Conditional Statement (<, >, =, etc),โCell 1 True Textโ,โCell 2 True Textโ) as the cell formula (blue arrow). For this example, Iโve used =IF(B2<C2,โShop 1โณ,โShop 2โณ).
- Drag down from the bottom-right corner of the comparison cell down to the last row you want to compare (black arrow). The โLess Expensiveโ column now tells you which shop has the lower price on a given product.
A Note About Less Than vs. Equal or Less Than Conditions
Since Iโve used the < (i.e., โLess Thanโ) condition, โPearsโ came back as cheaper at Shop 2, even though both shops have the same price. If I used <= (i.e, โEqual or Less Thanโ), the formula would have returned Shop 1.
Comparing Columns to Search for Missing Data in Google Sheets
Google Sheets can compare columns to see whether a selected cell in one column appears in any other column. This formula is extremely useful for finding missing information:
=IF(COUNTIF(Compare column start : Compare column End, Selected cell)=0, “True Response”, โFalse Response”)
For this example, Iโm using the following formula:
=IF(COUNTIF($C:$C, $A2)=0, “No”, “Yes”)
Note: This formula might seem confusing because I want to return the response โNoโ when the formula is true.

- Select the top cell in the comparison column (yellow arrow).
- Enter the formula (blue arrow). In the example. Iโm trying to see whether the Shop 1 product is available at Shop 2, so Iโve used: ย =IF(COUNTIF($C:$C, $A2)=0, โNoโ, โYesโ) to compare the selected A-column cell with all of column C.ย
- The =0 expression means the product is not found. The result will return โNoโ if this is true and โYesโ if false.
- Select the square in the bottom-right corner of the comparison cell and drag down to the last row youโre comparing (black arrow).
In this example, because Shop 2 doesnโt carry oranges, the result will return โNo.โ Shops 1 and 2 both carry pears, but they appear in different rows. The formula will return โYesโ since the cell value at A5 exists in Column C.
Related: How to use COUNTIF function in Google Sheets.
Comparing Each Row in One Column for a Match in Another Column
Rather than looking for whatโs missing, you can use Google Sheets to see what values exist in both columns. For example, you can compare two storesโ inventory to develop a list of products that are available at both:
=VLOOKUP(Comparison Cell, Comparison Column Range, Retrieve Value, Exact or Approximate Comparison)
Note: Use โFALSEโ for exact comparison and โTRUEโ for approximate comparison.โ
In this scenario, Iโm using the following formula:
=VLOOKUP(A2, $B$2:$B$5, 1, FALSE)
Here, Iโm trying to compare the value in cell A2 with all of the values in column B. If the condition of our VLOOKUP function comparison comes back as an exact match (indicated by FALSE), we want to return the matched value (indicated by 1).
To search columns for matching data:

- Select the top cell in the comparison column (yellow arrow).
- Enter the formula (blue arrow). In the example, Iโm using =VLOOKUP(A2, $B$2:$B$5, 1, FALSE) to compare the selected Column A cell against all of Column Bโs values. A value will be returned if thereโs a match in column C.
- Select the square in the bottom-right corner of the comparison cell and drag down to the last row youโre comparing (black arrow).
Note: The example color-codes the products to illustrate how they line up and which result value gets returned. #N/A is returned when the comparison cell doesnโt exist in the searched dataset.
Building a List of Duplicate Values Between Two Columns
When sorting data in Google Sheets, you may only want a given value to appear once between two columns. You can use Google Sheets to build a list of duplicates across columns.
The formula weโre using here is:
=IF(COUNTIF(Comparison Column, Comparison Cell)>0, Return True, Return False)
In my example, Iโm using this formula:
=IF(COUNTIF($B:$B, $A2)>0, $A2,””)
This formula will check all of column B for a match in the selected column A cell. Weโre using โ>0โ (i.e., greater than zero) as the condition. If true, weโll return to the selected column A cell value. If a duplicate isnโt found, the formula returns a blank value. In this example, Iโm sorting my kitchen tools between two shelves and am trying to locate duplicates.ย
To search columns for duplicate data:

- Select the top cell in the comparison column (yellow arrow).
- Enter the formula. In this example, Iโve used =IF(COUNTIF($B:$B, $A2)>0, $A2,โโ).
- Select the square in the bottom-right corner of the comparison cell and drag down to the last row youโre comparing (black arrow).
Note: The blue background highlights the location of the duplicate item across all columns.
Compare Columns in Google Sheets to Find Highest & Lowest Values
Google Sheets can identify the highest and lowest values across two columns on the same sheet. We do so by using the functions MAX and MIN.ย
To find the greatest value:

- Select the cell you want to show the results (yellow arrow).
- Enter the formula =max(range start:range end) in the cell (blue arrow). In the example case, Iโve used the range B2:C5.
If youโre trying to find the lowest value in the data group, simply use =min(range start:range end) instead of =max().
Productivity Spot for All of Your Spreadsheet Needs
These are just a handful of ways to compare data across two columns in Google Sheets. You can modify these techniques to do incredibly powerful data comparisons, like sorting a record collection or analyzing a businessโ product lineup.ย
To build your understanding of Google Workspace, why not check out Udemyโs range of courses? With thousands of online seminars, there are endless ways to build your skills!
Thank you!