Highlight matching values across two separate spreadsheet columns

Generate the exact conditional formatting formula and click-by-click instructions to mark duplicate values found across two columns.

Text prompt for ChatGPT and Claude

You get: The Formula, step-by-Step Setup and common Pitfalls to Avoid

Prompt

Prompt
You are a spreadsheet instructor. Write clear instructions and formulas to highlight values that appear in both of two separate columns.

- Provide the exact conditional formatting formula using COUNTIF.
- Give exact steps to apply the rule to both columns in Excel, Google Sheets, or both as relevant.
- Explain how to handle blank cells so empty rows do not highlight.
- State clearly that financial data must be verified before making balance adjustments.

Output format:
1. The Formula
2. Step-by-Step Setup
3. Common Pitfalls to Avoid

Here are my column letters and sample data:

Example output

Highlight matching vendor IDs in two columnsConditional formatting setup in Excel
  1. Select the data rangeStep 1Select Column A data, for example A2:A100
  2. Open New RuleStep 2Home tab, Conditional Formatting, New Rule
  3. Choose formula rule typeStep 3Use a formula to determine which cells to format
  4. Enter the COUNTIF formulaStep 4=AND(A2<>"", COUNTIF($B$2:$B$100, A2)>0)
  5. Pick a fill colorStep 5Click Format, choose soft yellow, click OK
  6. Repeat for Column BStep 6Use range B2:B100 with the reversed formula

Example for: matching vendor IDs in Column A and Column B

  1. The Formula
    =AND(A1<>"", COUNTIF($B:$B, A1)>0)
  2. Step-by-Step Setup
  • Select your data in Column A (for example, range A2:A100).
  • On the Home tab, click Conditional Formatting, then select New Rule.
  • Choose 'Use a formula to determine which cells to format'.
  • Enter the formula: =AND(A2<>"", COUNTIF($B$2:$B$100, A2)>0)
  • Click Format, choose a fill color (such as soft yellow), and click OK.
  • To highlight matches in Column B as well, repeat the steps for range B2:B100 with the formula: =AND(B2<>"", COUNTIF($A$2:$A$100, B2)>0)
  1. Common Pitfalls to Avoid
  • Forgetting dollar signs on the lookup range causes false positives as Excel shifts row references down.
  • Leading or trailing spaces will prevent exact matches; use the TRIM function if IDs fail to highlight.
  • Blank cells will evaluate as matches if you omit the blank check condition.
Written by AI from this prompt. Your results will vary.

Paste your column letters and a few rows of sample IDs right below the prompt in ChatGPT, Claude, or Gemini. As a follow-up, ask how to highlight only the first instance instead of all matches.

Reuse it: Use in a workflowTurn into a skillAdapt in the builder

Excel & Spreadsheets

Highlight entire spreadsheet rows using conditional formatting

Set up conditional formatting rules that color entire rows based on a single status cell. Use this to highlight completed, overdue, or pending project items.

Excel & Spreadsheets

Clean and Standardize Messy Spreadsheet Data with Exact Formulas

Get a column-by-column cleaning plan with ready-to-fill formulas for spaces, case, dates and duplicates, plus a list of rows that need a manual check.

Excel & Spreadsheets

Automate tiered color coding for approaching deadlines

Build dynamic, time-sensitive conditional formatting rules for due dates. Use this when trackers need automated green, yellow, and red warnings based on today's date.

Excel & Spreadsheets

Deduplicate spreadsheet rows keeping latest entry

Finds duplicate records in your data and generates clean formulas or step-by-step instructions to keep only the newest record.

Excel & Spreadsheets

Translate plain English requests into Google Sheets QUERY

Transforms plain business questions into working Google Sheets QUERY formulas with correct syntax, quotation marks, and date formats.

Excel & SpreadsheetsGemini

Build a Two-Variable Sensitivity Table for Revenue and Margin

Get a complete Excel sensitivity table layout with dynamic formulas and conditional formatting rules to highlight break-even profit thresholds.