The Wayback Machine - https://web.archive.org/web/20250130103223/https://www.geeksforgeeks.org/how-to-compare-two-columns-in-excel/
Open In App

How to Compare Two Columns in Excel : Easy and Quick Methods

Last Updated: 04 Jul, 2024

A

Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In the world of data analysis, knowing how to compare two columns in Excel is a fundamental skill that can unveil valuable insights and ensure data accuracy. If you’re looking to spot differences, find duplicates, or identify similarities, mastering Excel’s compare columns functionality is key.

This article will walk you through effective methods on how to compare two columns in Excel, exploring techniques to streamline your workflow and make informed decisions. By the end, you’ll be equipped with the knowledge to confidently manage and analyze your data using Excel compare two columns features. Let’s explore and learn the power of data comparison!

How-to-Compare-Two-Columns-in-Excel---Easy-and-Quick-Methods

How to Compare Two Columns in Excel

Why Compare Two Columns in Excel

Excel is a versatile tool that stores data and manipulates data for better decision-making. We are required to compare Excel columns data for the following reasons:

  • To find the unique value in the dataset.
  • To remove the identical data values from the dataset.
  • To reduce the size of the dataset.
  • To speed up the processing time for other Excel operations by reducing its size and removing identical data values.

How to Compare Two Columns in Excel

There are many different ways to compare your data when it is present in two different columns, tables, or spreadsheets to make sure that there shouldn’t be any missing or duplicate data present in the columns.

Below are some methods to compare two columns :

  • Highlighting the unique or duplicate values in each column using Functions
  • Display Unique or duplicate using conditional formatting or formulas.
  • Comparison through row by row
  • Using LOOKUP formulas.

In this example, we will be using random cities’ names in two different columns and comparing them to find duplicate or unique cities’ names. For this example, we will create the following dataset. The dataset will contain two columns as Cities A and Cities B, which will contain random names of cities. Below is the screenshot of the dataset attached.

Fig158

Dataset

Compare Two Columns in Excel using Conditional Formatting

In this method, we will the Conditional Formatting rules provided by Excel to compare the two columns and highlight the DUPLICATE DATA between the two columns.

Step 1: Select the data

First, we will select the data cells of Excel for which we want to compare the data.

Fig159

Select the Data

Step 2: Conditional Formatting

In this step, we will do the conditional formatting for our selected cell’s data and set the rules for highlighting the duplicate values. For this go to Home > Styles > Conditional Formatting > Highlight Cells Rules > Duplicate Values.

Fig161-660x274

Conditional Formatting

Once we click on Duplicate Values, excel will pop up a tab asking for a formatting rule. We can select the according to our requirements.

Fig160

Select Duplicate

After setting the rule(Here, Light Red color for cells having duplicate data values) we need to click on the OK button.

Step 3: Output

Once we set the formatting rules and click on the OK button, excel will automatically Highlight the cells according to the formatting rule.

Fig162

Output

Highlight Unique Data

In this method, we will use the Conditional Formatting rules provided by Excel to compare the two columns and highlight the UNIQUE DATA between the two columns.

We are required to repeat the same steps as we did in Method 1. But we need to make sure, to change the formatting rule. This time we need to format the cells that contain unique elements, not duplicate elements.

Note: Keep in mind to change the formatting rule for unique data.

Fig163

Change formatting to Unique

Output

Once we will change the rule for unique element comparison and click on the OK button, Excel will automatically update the sheet according to the unique element.

Compare Two Columns in Excel Using Equals Operator

In this method, we will create one more column in our existing dataset as Result which will be used for storing the matched and unmatched responses.

Step 1: Add an Excel New Column

In this step, we will add a new column as “Result” for adding the response as TRUE or FALSE.

Fig165

Add New Column in Excel

Step 2: Adding Comparison Formula

In this step, we will add a formula in our Result column to compare whether the two columns contain equal data or not.

=A2=B2(We are using A2 and B2 cells for comparison, you need to change according to your own cells).

Fig166

Add Formula

After using formula in one row, we need to fill the same formula for all the rows. To use the same formula in all rows, Select the bottom right corner of the cell(Here, C2) and pull it down to the cell. Excel will fill the same formula in all the rows.

Fig167

Select the Bottom right corner

Step 3: Output

Once we have our comparison formula filled in all the rows, excel will automatically fill TRUE for matched and FALSE for unmatched entities.

Fig168

Output

Compare Two Columns in Excel Using the IF Condition

You can also use the IF condition to compare two columns in Excel. The Formula that can be used is =IF(A2=B2,”MATCH”,” “). It will return the result as MATCH against the rows that contain, matching values, and the remaining rows will show Not Match.

Screenshot-(240)

Result

Compare Two Columns in Excel Using the EXACT() Function

The EXACT() Function is used to compare two text strings and returns TRUE if they are the same and FALSE if they are not the same. EXACT is case-sensitive but it ignores formatting differences.

Syntax: =EXACT(text1,text2)

It takes two arguments text1, and text2.

Let’s consider the below Example. There are two columns Cities1 and Cities2. The formula =IF(EXACT(A2,B2),”Match”,”Not match”)

Screenshot-(275)-(1)

Enter Formula

The EXACT() returns values as True or False. The execution of the formula would be: First, the inner function would be executed, and the result returned.

Using the VLOOKUP Function to Compare Two Columns

The LOOKUP function is used to search for a particular value in a particular row or column and return the result from another row or column. Excel has various lookups such as VLOOKUP (V stands for vertical), HLOOKUP (H stands for horizontal), and XLOOKUP (combination of both VLOOKUP and HLOOKUP).

Let’s see the below example to compare two columns using VLOOKUP.

Screenshot-(238)

Using VLOOKUP

Where Column A consists of a list of exams given by a student and Column B is a list of

subjects that students passed. The result sheet should contain a list of all the subjects. The VLOOKUP() is applied in cell C2 as =VLOOKUP(A2, $B$2:$B$4,1,0).

Drag the formula to apply it in the cell below C2. You will find the result in column C with the subjects that are cleared and those that have not been passed as N/A.

Conclusion

In conclusion, understanding how to compare two columns in Excel is essential for ensuring data integrity and making informed decisions in your analysis. Whether you’re using Excel to identify discrepancies, locate matches, or streamline data cleansing processes, the ability to compare columns in Excel effectively enhances your productivity and accuracy. By leveraging the techniques and tools discussed in this article, such as Excel compare two columns features, you can confidently handle data comparisons and achieve reliable results. Start harnessing the power of Excel’s data comparison capabilities today to streamline your workflows and elevate your data analysis skills.

How to Compare Two Columns in Excel – FAQs

How do I compare two columns in Excel for differences?

To compare two columns in Excel for differences, you can use conditional formatting or formulas like IF and COUNTIF to highlight discrepancies between the two columns. For example, you can use a formula like =IF(A1<>B1, “Different”, “Same”) in a third column to flag where values differ between columns A and B.

How do you compare two lists in Excel for matches?

To compare two lists in Excel for matches, you can use formulas like VLOOKUP, INDEX MATCH, or COUNTIF. These formulas help you identify common items between two lists or check if items from one list exist in another.

How do I compare two columns of similar data in Excel?

Comparing two columns of similar data in Excel involves techniques like conditional formatting to highlight matching or non-matching values, or using formulas like IF, COUNTIF, or VLOOKUP to perform detailed comparisons.

Can I use VLOOKUP to compare two columns?

Yes, you can use VLOOKUP to compare two columns in Excel. VLOOKUP is useful for finding matching values in one column based on values in another column. It can help you identify common or unique entries between two columns.

How to compare two columns in excel for matches and differences?

To compare two columns in Excel for both matches and differences, you can combine formulas and conditional formatting. Use formulas like VLOOKUP, IF, COUNTIF, or conditional formatting rules to highlight matching values and flag differences between the two columns.



A

News
Improve
Discuss
Do you want to advertise with us?Click here to know more

How to Compare Two Lists in Excel: 5 Easy Methods

article_img
Comparing two lists in Excel is a powerful way to identify matches, differences, or duplicates within your data. Whether you’re working with inventory records, customer databases, or project tasks, knowing how to compare two lists in Excel can save time and improve accuracy. Excel offers several tools for this purpose, such as formulas like VLOOKUP, IF, as well as conditional formatting. This guide will walk you through step-by-step methods to effectively compare two lists in Excel, ensuring you can analyze your data quickly and efficiently. Table of Content Why Compare Two Lists in ExcelHow to Compare two Lists in Excel : 5 Different MethodsMethod 1: Using Conditional Formatting Method 2: Using the Equal Sign Operator Method 3: Using VLOOKUP Formula Method Method 4: Using Row Difference Method 5: Using IF ConditionWhy Compare Two Lists in ExcelComparing two lists is essential for tasks like: Identifying missing or duplicate entries.Validating records between two databases.Analyzing differences in inventory, sales, or employee datasets.Excel offers versatile tools to help you achieve these objectives with ease. How to Compare two Lists in Excel : 5 Different MethodsWhen working wit
Read More

Excel Transpose: Convert Rows to Columns (4 Easy Methods)

article_img
Have you ever needed to switch rows to columns or vice versa in Excel without retyping your data? The Transpose function in Excel makes this process quick and hassle-free. Whether you're working with simple data sets or complex tables, understanding how to use Excel Paste Special Transpose or formulas like INDIRECT + ADDRESS can save you time. This guide will walk you through efficient methods to transpose data, including automation tips with VBA, ensuring your workflow remains smooth and productive. Why Transpose Data in ExcelTransposing data is useful when: Formatting Issues: You need to adjust your data layout for better readability or presentation.Pivoting Data: Rows need to become columns (or vice versa) for specific analyses or visualizations.Reporting Needs: Rearrange data to match report templates or formatting guidelines.4 Methods to Transpose Excel DataExcel provides multiple ways to transpose data, allowing you to switch rows into columns or vice versa effortlessly. These methods are designed to cater to different needs, whether you prefer manual adjustments, formula-based dynamic transpositions, or automated VBA solutions. Method 1: Using Paste SpecialTo change rows to
Read More

How to Use ChatGPT in Telegram: Easy & Quick Methods

article_img
Among the foremost feature-rich informing apps accessible is Telegram, which has over 700 million month-to-month dynamic clients worldwide. ChatGPT in Telegram was among the primary ones to receive the concept of bots. The bots have empowered computerized capacities, such as record transformation, broadcasting, and email administration. As one might anticipate, AI chatbots are far too exceptionally well-known on Telegram. Having ChatGPT on telegram makes receiving instant answers to your queries easy. The best part is that you can also engage in voice-based conversations with ChatGPT. Capturing human-like interactions and remembering the context of the discussions is one of ChatGPT's primary advantages. Although many people still find it difficult to access, particularly on mobile devices, this makes it the perfect chatbot. In this article, we'll explore ways to answer the most popular query - How to Use ChatGPT in Telegram. Table of Content How to Set Up ChatGPT for TelegramHow To Use ChatGPT in Telegram? BuddyGPT: How to Use ChatGPT in Telegram? Using ChatGPT Telegram Bot Free with Roger Da VinciHow To Use ChatGPT on Telegram with ChatGPT Bot?Benefits of Using ChatGPT Bot on Tele
Read More

How to Compare Two Columns and Delete Duplicates in Excel?

Many a time while working with Microsoft Excel or MS Excel or Excel, we came up with a situation where we have duplicate values in columns and rows and the first task is to remove all the duplicates before proceeding to the next step. But before removing duplicates, we need to find out where these duplicates are present and for that we need to compare columns and rows to find the duplicate entry. After the duplicate values are found, we need to highlight them and remove them. The above process will be explained using excel commands. Comparing two columns in MS ExcelFollow the following steps to compare two columns in excel: Note: This tutorial is for MS Excel 2013. Steps can be different or the same for other versions of Excel. Step 1: Open the Excel file on which you want to compare the columns. For Example, your data can look like this Step 2: Select the columns and go to the Home tab > Style group> Conditional Formatting i.e first click on Home tab, then go to Style group and then select Conditional Formatting (as shown in the image below). Conditional formatting allows users to automatically apply formattings such as changing colors, data bars, and icons in the cells base
Read More

How to Hide and Unhide Columns in Excel 2024: Easy Steps and Tips

article_img
Want to master Excel and improve your data management skills? Knowing how to hide and unhide columns in Excel can streamline your workflow, especially when dealing with large datasets. Instead of deleting columns, hiding them allows you to focus on essential information. In this 2024 article, you will learn effective methods for hiding and unhiding columns in Excel, ensuring a cleaner and more organized spreadsheet. We'll cover everything from hiding columns in Excel 2016 to using formulas to manage your spreadsheet's visibility. By the end of this article, you'll be able to easily hide and unhide columns in Excel, making your workflow smoother and more organized. Let's get started and explore the various methods and shortcuts to hide columns in Excel. Table of Content How to Hide the Column in ExcelWhat is Hiding a Column in Excel How to Hide a Column Using Ribbon in ExcelHow to Hide Columns in Excel using Shortcut How to Hide Columns Using a Context Menu in ExcelHow to Hide Excel Columns by Setting the Column Width as ZeroHow to Hide Column Using VBA CodeHow to Hide Unused Column in Excel How to Hide and Show Columns using the Group FeatureHow to Hide Columns with Plus (+) Sign H
Read More

How to Wrap Text in Excel Automatically and Manually - 3 Easy Methods

article_img
How to Wrap Around Text in Excel - Quick StepsSelect the cell(s).Go to Home >> Click Wrap Text.Adjust the row height if needed.Wrapping text in Excel is a simple yet essential feature that ensures your data is displayed clearly and fits neatly within each cell. When working with long entries, such as names, addresses, or descriptions, text may overflow into adjacent cells or become hidden. This guide will show you how to wrap text in Excel, making your data more readable and organized. Whether you're managing reports, creating tables, or formatting large datasets, wrapping text improves presentation and helps maintain a professional look. Table of Content What Is Text Wrapping in Excel?How to Wrap Text in Excel Automatically (Windows & Mac)Method 1: Wrap Text Using the Ribbon (Wrap Text Button)Method 2: Wrap Text Using Format CellsMethod 3: Using the Keyboard ShortcutHow to Wrap Text in Excel Manually with Line BreaksHow to Unwrap Text in Excel using Right ClickTroubleshooting Common Text Wrapping IssuesWhat Is Text Wrapping in ExcelText wrapping in Excel adjusts the way text is displayed in a cell. Instead of text overflowing into adjacent cells or being cut off, wrappin
Read More

How to Separate First and Last Name in Excel: 3 Easy Methods

article_img
How to Split Names in Excel - Quick StepsOpen MS Excel>>Select the ColumnOpen Text to Columns WizardChoose Delimited>>Select DelimitersSet Destination>>Adjust ColumnsManaging datasets with full names in a single column can be challenging when you need the names split into first and last names. Knowing how to separate first and last names in Excel is a practical skill that improves data clarity and organization. Whether you're working on a mailing list, a contact sheet, or any dataset requiring distinct name columns, Excel offers straightforward solutions. Using tools like Text to Columns, Flash Fill, Excel formulas or formulas like LEFT, RIGHT, and SEARCH, you can effortlessly break names into individual components. This guide will walk you through step-by-step methods to split names in Excel, saving time and ensuring your data is well-structured and ready for analysis. Table of Content How to Separate Names in Excel: 3 MethodsMethod 1: How to Split Names in Excel Using Text to ColumnsMethod 2: How to Separate First and Last Name in Excel with FormulasMethod 3: How to Split Names in Excel Using Flash FillHow to Split Full Name into First, Last, and Middle Name in
Read More

How to Convert Excel to Word: 4 Easy and Effective Methods

article_img
Transferring data from Excel to Word is a common need for creating professional documents, reports, or presentations. This article explains 4 simple and effective methods to convert Excel to Word, ensuring your data maintains its structure and format. Whether you're embedding a table, linking live data, or using copy-paste techniques, this guide provides clear instructions tailored to suit various requirements. Ideal for users seeking a smooth workflow between Excel and Word, this article will help streamline the process for both beginners and professionals. Table of Content Why Convert Excel to WordMethod 1: Copy & Paste a Table from Excel to a Word documentMethod 2: Embed an Excel file into WordMethod 3: Use Mail Merge for Dynamic DataMethod 4: Export Excel Charts to WordTips for a Smooth Conversion from Excel to WordWhy Convert Excel to WordEnhanced Formatting: Word is better for creating formal reports and documents with formatted text.Ease of Sharing: Word documents are more suitable for printed or shared materials.Integration with Other Content: Combine Excel data with text, images, or diagrams in a Word document.Method 1: Copy & Paste a Table from Excel to a Word doc
Read More

How to Split Cells in Excel: Easy Methods Explained

article_img
How to Separate a Cell in Excel- Quick StepsOpen MS Excel>>Select Data Go to the Data tab>>Click Text to Columns.Choose Delimited and click NextSplitting cells in Excel can simplify data management, especially when dealing with combined information in a single column or cell. Whether you’re separating names, dates, or other data points, understanding how to split cells in Excel is essential for better organization and clarity. This guide will show you how to break up cells in Excel using different methods. By the end, you'll know how to split cells horizontally, divide a cell in Excel for better Management. Table of Content What Does Splitting Cells in Excel MeanHow to Split Cells in Excel Using Text to Columns - 2 MethodsHow to Split Cells in Excel Using FormulasHow to Split Cells in Excel Using Flash Fill - 2 MethodsHow to Split Cells in Excel Using Power QueryHow to Divide a Cell in Excel in Excel Using Text Functions in ExcelCommon Use Cases for Splitting Cells in ExcelWhat Does Splitting Cells in Excel MeanSplitting a cell in Excel involves dividing its content into multiple cells or columns. For instance, you can: Separate first and last names.Break product catego
Read More

How to Insert Multiple Rows in Excel: 4 Easy Methods

article_img
How to Add Multiple Rows in ExcelSelect Rows >> Highlight the same number of rows you want to insert.Insert Rows >> Right-click and choose Insert.If you're looking to insert multiple rows in Excel quickly and without hassle, you're in the right place. Whether you're working with a simple table or a complex dataset, knowing how to add multiple rows in Excel is an essential skill. In this guide, we'll walk you through four easy methods to insert multiple rows at once. From using keyboard shortcuts to using the Insert option, copy-pasting, or even using the Name Box regardless of whether you're using Windows or Mac, these techniques will help you save time and keep your data organized. Table of Content How to Insert Multiple Rows in Excel using the Insert OptionHow to Insert Multiple Rows using an Excel ShortcutHow to Insert Multiple Rows using the Copy and Paste MethodHow to Insert Multiple Rows Using Name BoxHow to Insert Multiple Rows in Excel using the Insert OptionIf you are searching how to insert more than one row in excel between data automatically then adding rows using the Insert option would be the best method, This method is simple and effective for quickly add
Read More
three90RightbarBannerImg