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

Data Analysis

  • Filter Data Based on Date in Excel
  • Use Data Form to input, edit and delete records in Excel
  • How to create a Histogram in Excel
  • Conditional Formatting Color Scales Examples in Excel
  • How To Create Pareto Chart in Excel

References

  • Left Lookup in Excel
  • Count rows that contain specific values in Excel
  • How to use Excel INDIRECT Function
  • How to use Excel VLOOKUP Function
  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation

Data Validations

  • Excel Data validation allow weekday only
  • Excel Data validation whole percentage only
  • Excel Data validation must not contain
  • Excel Data validation specific characters only
  • Excel Data validation no punctuation

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:

COSH function: Description, Usage, Syntax, Examples and Explanation

Next Post:

Excel Data validation require unique number

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

  • NOT function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel AND Function
  • Not Equal To ‘<>‘ operator in Excel
  • How to return blank in place of #DIV/0! error in Excel
  • Nested IF function example in Excel

Date Time

  • Get work hours between dates and times in Excel
  • Get month from date in Excel
  • Add months to date in Excel
  • Get week number from date in Excel
  • SECOND function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • Map inputs to arbitrary values in Excel
  • If cell contains one of many things in Excel
  • How to randomly assign data to groups in Excel
  • Group times into 3 hour buckets in Excel
  • How to randomly assign people to groups in Excel

General

  • Create dynamic workbook reference to another workbook in Excel
  • How to Insert Cells, Row and Rows in Excel
  • How to password protect excel sheet?
  • How to calculate percent of goal in Excel
  • Creating and Opening an existing file in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning