Organize information

Find and handle duplicate records in Excel

Define duplicate identity, detect exact and near matches, and preserve conflicts for review

7 min setupTested with:ChatGPTReviewed: 2026-08-28
1

Add your context

Your text stays in this browser. AILesson Prompts does not send it to a model or server.

2

Your prompt

Unfilled fields remain visible as placeholders, so you can still copy and edit the prompt

Design an Excel workflow to find and handle duplicate records.

Duplicate definition:
[identity]

Columns and representative duplicate cases:
[layout]

Resolution policy:
[policy]

Distinguish exact duplicate rows, repeated business keys, and possible near matches. Do not recommend Remove Duplicates until the identity rule and conflict policy are explicit. Return helper formulas or conditional-formatting rules, duplicate group IDs, conflict checks, and separate actions for safe exact duplicates, conflicting duplicates, and uncertain near matches. Preserve source rows and show how to reconcile counts before and after resolution.
Private by defaultPrompt assembly happens locally in your browser. Avoid placing confidential information into any AI service unless your organization allows it.

From input to outcome

A worked example

See how concrete context turns this recipe into a usable result

Actual input

Duplicate definition
For a contact export, normalized email is the business key. Two rows with the same email are possible duplicates even if name capitalization differs. Rows with blank email are never auto-matched by name alone.
Columns and sample duplicates
A RowID; B FullName; C Email; D UpdatedAt; E Source; F Phone. Examples: R10/Ana/ANA@example.com/1 Jun/Web/123; R14/Ana Pérez/ana@example.com/4 Jun/CRM/blank; R20/Ana Perez/blank/5 Jun/Event/123.
Resolution policy
Exact identical rows may be marked redundant. For the same normalized email, retain the latest nonblank values only after conflicts are shown. Blank-email near matches require human review. Never delete the raw sheet.

Example output

Create G NormalizedEmail with =IF(C2="","",LOWER(TRIM(C2))); H EmailCount with =IF(G2="","",COUNTIF($G:$G,G2)); and I DuplicateGroup with =IF(H2>1,"EMAIL-"&G2,""). Blank emails stay ungrouped. Add conflict flags such as =IF(I2="","",COUNTA(UNIQUE(FILTER($F:$F,$I:$I=I2)))>1) for nonblank phone values, adjusted to exclude blanks if needed.

R10 and R14 join the same email group; they are not safe deletions because name, timestamp, source, and phone completeness differ. R20 remains an uncertain near match and receives ManualReview rather than the email group. Create an action column with ExactRedundant, MergeReview, NearMatchReview, or Unique. Keep Raw_ReadOnly, produce a separate resolved table, and maintain a ResolutionLog containing removed RowID, retained RowID, rule, reviewer, and date. Reconcile raw rows = resolved rows + exact redundant rows + merged rows retained in the log; also compare the unique normalized-email count before and after.

Why this works

  1. 1

    Defining identity before deletion prevents legitimate repeated events from being lost.

  2. 2

    Grouping conflicts keeps evidence available for a human merge decision.

Check the result

  • Does the duplicate key reflect business identity rather than visual similarity?

  • Are conflicting values preserved and assigned to review?

  • Can removed rows be traced to a retained record?

More ways to explore

Where this recipe fits

Keep the work moving