简体   繁体   中英

Highlight cells based on the value of cells in another column

I have this problem as noted below:

Column A = Part number

Column B = Quantity

Column C = Part number

Column D = Quantity

Using conditional formatting, I would like to highlight if the combination of Part number and Quantity in Column A and B is different to the combination of Part number and Quantity in Column C and D.

Eg:

     Col A   Col B   Col C   Col D  
 1   1111     2      1112     5
 2   1112     3      1111     2
 3   1131     5      1112     5
 4   1122     3      1131     2

To do this, I'd like to set up a couple of 'helper' columns (say E & F) by concatenating Column A & B, C & D.

So essentially, I'd like to take the information from the helper columns E & F, but use conditional formatting to highlight the cell in column B and D.

From the example above, cell B3 and D4 would be highlighted.

Is this possible, and if not, is there are simple alternative? (I don't mind using a macro if need be)

Thank you

I would use COUNTIFS

For B1:B4

=COUNTIFS($C$1:$C$4,A1,$D$1:$D$4,"<>"&B1)

and for D1:D4

=COUNTIFS($A$1:$A$4,C1,$B$1:$B$4,"<>"&D1)

在此输入图像描述

如果您甚至想跳过辅助列,可以使用=$A1&$B1<>$C1&$D1格式化A1并将格式复制到要突出显示的任何单元格(甚至是帮助列)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM