Formatting Issues

How to Highlight Duplicate IDs with Different Prices in Excel

John WilsonJohn Wilson Nov 10, 2026 869 views

Question details

The user needs to highlight prices in a specific column when the corresponding part number in another column appears multiple times, but the price for that part number varies.

How to Highlight Duplicate IDs with Different Prices in Excel
Product
Excel
Device & OS
not provided
Scenario
Auditing a pricing list where identical part numbers should ideally have the same price, requiring a visual way to identify pricing discrepancies within duplicate groups.
Observed behavior
Prices for duplicate part numbers need to be automatically highlighted using a formula to spot variations efficiently.
Before you start

Ensure your data does not contain trailing spaces or invisible characters, as these can cause the COUNTIF and COUNTIFS formulas to misinterpret duplicate text strings or numbers.

Solution 1Recommended

Use a Formula-Based Conditional Formatting Rule

Apply a combination of COUNTIF and COUNTIFS formulas to identify duplicate IDs that have unique prices.

This method uses the logical AND function to check two conditions simultaneously: first, whether the part number appears more than once, and second, whether the specific combination of part number and price appears exactly once.

1
Select the Target Range

Highlight the price range (e.g., C3:C997) where you want the formatting to appear. Note the first active row in your selection (e.g., row 3).

2
Open Conditional Formatting

Navigate to the Home tab on the Excel ribbon, click 'Conditional Formatting', and select 'New Rule'.

3
Enter the Formula

Choose 'Use a formula to determine which cells to format'. Enter the following formula, adjusting references to match your data: =AND(COUNTIF($A$3:$A$997,$A3)>1,COUNTIFS($A$3:$A$997,$A3,$C$3:$C$997,$C3)=1).

4
Apply Formatting

Click the 'Format' button, select a fill color (like yellow or red) to highlight the discrepancies, and click 'OK' twice to apply the rule to your data.

Use a Formula-Based Conditional Formatting Rule
Formula Cell References: Make sure to lock the full data ranges with absolute references (like $A$3:$A$997) but keep the row number relative for the active cell references (like $A3 and $C3).
Powerful Spreadsheet Alternative

Easily Highlight Complex Duplicate Data in WPS Spreadsheet

WPS Spreadsheet fully supports advanced conditional formatting formulas, allowing you to highlight complex data patterns exactly like Microsoft Excel. It is free, lightweight, and features a familiar interface.

  1. 1. Open your file in WPS Office: Launch WPS Spreadsheet and open the document containing your pricing data.
  2. 2. Select your data: Highlight the price column where you want to spot discrepancies.
  3. 3. Create a new formatting rule: Go to the Home tab, click 'Conditional Formatting', and choose 'New Rule'.
  4. 4. Apply the custom formula: Select 'Use a formula to format cells', paste your COUNTIF and COUNTIFS combination formula, set your desired highlight color, and click 'OK'.
Full compatibility with Microsoft Excel (.xlsx) formats and advanced conditional formatting rules.Familiar ribbon interface makes it easy to apply and manage complex COUNTIF and COUNTIFS formulas.Lightweight architecture ensures fast processing when auditing large datasets for duplicates.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my conditional formatting formula highlighting the wrong rows?

This typically happens if the active cell you selected when creating the rule doesn't match the relative reference in your formula. Ensure that if your selected range starts at row 3 (e.g., C3:C100), your formula references row 3 (e.g., $A3 and $C3).

Can I highlight the entire row instead of just the price cell?

Yes. Instead of selecting just the price column, select the entire data range (e.g., A3:C997). Use the exact same formula, making sure the column references ($A and $C) are absolute and the row numbers are relative.

How do I clear the conditional formatting rules if I make a mistake?

Go to the Home tab, click on Conditional Formatting, select Clear Rules, and choose either 'Clear Rules from Selected Cells' or 'Clear Rules from Entire Sheet' to remove the formula.