Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Managing Conditional Formatting Rules in Excel
  • Reverse List in Excel
  • How To Insert and Customize Sparklines in Excel
  • How to create dynamic reference table name in Excel
  • How to calculate current stock or inventory in Excel

References

  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions
  • How to use Excel FORMULATEXT function
  • How to get last row in text data in Excel
  • How to get last row in numeric data in Excel
  • How to get first row number in range in Excel

Data Validations

  • Excel Data validation exists in list
  • Excel Data validation date in next 30 days
  • Excel Data validation whole percentage only
  • Excel Data validation allow uppercase only
  • How To Create Drop-down List in Excel

Find duplicate values in two columns in Excel

by

This tutorial shows how to Find duplicate values in two columns in Excel using the example below;

Formula

=AND(COUNTIF(range1,A1),COUNTIF(range2,A1))

Explanation

To highlight duplicate values in two or more columns, you can use conditional formatting with on a formula based on the COUNTIF and AND functions.

In the example shown, the formula used to highlight duplicate values is:

=AND(COUNTIF(range1,B5),COUNTIF(range2,B5))

Both ranges were selected at the same when the rule was created.

How this formula works

This formula uses two named ranges, “range1” (B5:B12) and “range2” (D5:D10).

The core of this formula is the COUNTIF function, which returns a count of each value in both range inside the AND function:

COUNTIF(range1,B5) // count in range1
COUNTIF(range2,B5) // count in range2

COUNTIF will either return zero (evaluated as FALSE) or a positive number (evaluated as TRUE) for each value in both ranges.

If both counts are positive (i.e. non-zero), the AND function will return TRUE and trigger the conditional format.

Post navigation

Previous Post:

VLOOKUP with two client rates in Excel

Next Post:

How to Create Gantt Chart in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • IF with wildcards in Excel
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • TRUE function: Description, Usage, Syntax, Examples and Explanation
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel NOT Function

Date Time

  • Count birthdays by month in Excel
  • Get days between dates in Excel
  • How to calculate percent of year complete in Excel
  • WEEKNUM function: Description, Usage, Syntax, Examples and Explanation
  • Convert Excel time to Unix time in Excel

Grouping

  • Group times into 3 hour buckets in Excel
  • Group numbers with VLOOKUP in Excel
  • Running count group by n size in Excel
  • Map inputs to arbitrary values in Excel
  • How to randomly assign people to groups in Excel

General

  • How to set or clear a print area in Excel Worksheet
  • Count cells that do not contain many strings in Excel
  • Split Cell Content Using Text to Columns in Excel
  • Subtotal invoices by age in Excel
  • Basic numeric sort formula in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning