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

Data Analysis

  • How to Create Area Chart in Excel
  • Move chart to a separate worksheet in Excel
  • Understanding Pivot Tables in Excel
  • Conditional Formatting New Rule with Formulas in Excel
  • How to Sort by Color in Excel

References

  • How to get address of first cell in range in Excel
  • Multi-criteria lookup and transpose in Excel
  • How to calculate two-way lookup VLOOKUP in Excel Table
  • MATCH function: Description, Usage, Syntax, Examples and Explanation
  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation

Data Validations

  • Data validation must not exist in list
  • Excel Data validation require unique number
  • Excel Data validation only dates between
  • Excel Data validation whole percentage only
  • Excel Data validation exists in list

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

  • Invoice status with nested if in Excel
  • Excel If, Nested If, And/Or Criteria Examples
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • Not Equal To ‘<>‘ operator in Excel
  • Complete List of Excel Logical Functions, References and Examples

Date Time

  • EDATE function: Description, Usage, Syntax, Examples and Explanation
  • Get work hours between dates and times in Excel
  • Get days, hours, and minutes between dates in Excel
  • Add decimal minutes to time in Excel
  • How to calculate future date say 6 months ahead in Excel

Grouping

  • Running count group by n size in Excel
  • Calculate conditional mode with criteria in Excel
  • Group numbers with VLOOKUP in Excel
  • Map text to numbers in Excel
  • Group numbers at uneven intervals in Excel

General

  • Automatically fill series of cells in Excel using AutoFill
  • Excel Ribbon Quick Overview For Beginners
  • How to increase by percentage in Excel
  • AutoRecover file that was never saved in Excel
  • How to generate random times at specific intervals in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning