Compare All Columns with Each Other for Duplicates in Google Sheets

Do you have several lists and want to compare them to find and list out the duplicates?

You can easily do that using my custom named functions in Google Sheets.

To compare all columns with each other in a range and list out the duplicates, you just need to import and use my two named functions: COMPARE_ALL_COLUMNS and CAC_CHILD.

It’s super simple! You only need to provide the range reference — for example, A2:C7.

The comparison will happen between:

  • A2:A7 & B2:B7
  • A2:A7 & C2:C7
  • B2:B7 & C2:C7

Let’s see it in action:

Compare All Columns with Each Other for Duplicates — Example 1

Example #1

Compare all columns with each other for duplicates — Example 1 in Google Sheets
example # 1

In this example, the child function (CAC_CHILD) returns the columns being compared in E2:E4, and the main function (COMPARE_ALL_COLUMNS) lists the duplicate values found during the comparison.

Here’s another example to compare all columns with each other and return the duplicates in Google Sheets:

This time, we’ll be working with five columns.

  • Range: A2:E8
  • Child Formula: G2
  • Master Formula: H2

Compare All Columns with Each Other for Duplicates — Example 2

Example #2

Compare all columns with each other for duplicates — Example 2 in Google Sheets
example # 2

In real-life scenarios, you can use these functions to quickly check if the same names (or any data) appear across multiple teams, lists, or departments.

COMPARE_ALL_COLUMNS and CAC_CHILD: Syntax and Arguments

Syntax:

COMPARE_ALL_COLUMNS(range)

Arguments:

ArgumentDescription
rangeThe range of columns you want to compare with each other to find duplicates. You can pass a standard range reference like A2:C100, or an array like {A2:A100, B2:B100, C2:C100} — useful if your columns aren’t adjacent!

Syntax:

CAC_CHILD(range)

Arguments:

ArgumentDescription
rangeThe columns you want to identify for comparison. Same as above: either a regular range or an array of separate columns.

How to Import the Functions

You can import these custom functions from my sample Sheet below and start using them to compare all columns with each other for common values.

Sample Sheet

Instructions:

  1. Click the button to make a copy of my Sheet.
  2. Open the Sheet where you want to use these functions.
  3. Go to Data > Named functions > Import function.
  4. Follow the on-screen instructions — and you’re all set!

Now you can quickly compare all columns with each other in any range and return the duplicates or common entries.

Quick Recap with Examples

As mentioned earlier, here are the formulas used in the first example:

  • E2 (Child Function):
    =CAC_CHILD(A2:C7)
  • F2 (Main Function):
    =COMPARE_ALL_COLUMNS(A2:C7)

✅ You can even include distant (non-adjacent) columns by providing them as an array like {A2:A7, F2:F7, Z2:Z7} in the range argument.

The E2 formula shows which columns are being compared, and the F2 formula compares all columns with each other to return matching/duplicate values.

Can I Use an Open Range Like A2:C Instead of A2:A7?

Yes, you can.

But I recommend using closed ranges (like A2:A7) whenever possible to improve performance in Google Sheets, especially when working with larger datasets.

In the second example, for instance, I used an open range:

  • G2:
    =CAC_CHILD(A2:E)
  • H2:
    =COMPARE_ALL_COLUMNS(A2:E)

Final Thoughts

I hope the examples above make it clear how to use the custom functions COMPARE_ALL_COLUMNS and CAC_CHILD to easily compare all columns with each other for duplicate values in Google Sheets.

If you need more help working with multiple columns, check out these related tutorials:

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

Count Consecutive Workday Absences in Google Sheets

This tutorial offers a powerful formula-based solution to count consecutive workday absences in Google...

More like this

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

Count Consecutive Workday Absences in Google Sheets

This tutorial offers a powerful formula-based solution to count consecutive workday absences in Google...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.