excelhighlightduplicate-dataerror-checkingrange-checking

Highlight rows where the same values in columns A:B but different values in column C


I have 4000+ rows of data need to be working on. Where column A represents the SKU, column B represents the unit and column C represents the Unit Price. The same SKU, Unit and Unit Price may duplicate at their own columns as shown as the picture attached. I need to check and highlight whether which SKU, appears to have different Unit Price but with same Unit. Which mean same SKU (Column A), same Unit (Column B) but different in Unit Price (Column C).

Is there any possible method or formula for doing this checking instead of checking row-by-row manually?

[How to I find the same cases just like row 4 in the picture (with same SKU, same Unit but different Unit Price)

How to I find the same cases just like row 4 in the picture (with same SKU, same Unit but different Unit Price?


Solution

  • You can design a Conditional Formatting rule using a formula based on the COUNTIFS function. If you set a rule such that there must be at least two other rows with the same SKU and Unit combination but with different Unit Prices then a formula can be easily derived.

    First, select all of columns A:C then go to Home ► Styles ► Conditional Formatting ► New Rule. Opt for Use a formula to determine which cells to format and supply the following for the Format values where this formula is true: text box.

    =AND(ROW(A1)>1, COUNTIFS($A:$A, $A1, $B:$B, $B1, $C:$C, "<>"&$C1)>1)
    

    Click Format and apply some formatting the OK to accept the formatting and OK again to create the new rule. Your results should resemble the following.

            Conditional Formatting rogue unit prices

    Note that I've added one more row of data to the sample data.