简体   繁体   中英

Complex conditional formatting based on values of some cells

I have a sheet like following

  | A     | B    | C    |
1 | Name1 | a    | b    |
2 |       | key1 | val1 | 
3 |       | key2 | val2 |
4 |       | key3 | val3 |
5 | Name2 | a    | b    |
6 |       | key1 | val1 | 
7 |       | key2 | val4 |
8 |       | key3 | val5 |

What I want to do, is if (C1 = 'b') then format C2:C4 then highlight all val# cells that are duplicate. So in the table above cells val1 would be highlighted.
Is this possible at all?

I believe this achieves what you ask (though why you want that is another matter):

Clear any existing CF from ColumnC, select ColumnC and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: :

=OR(AND(C$1="b",ROW()<5),MATCH(C1,C$2:C$4,0))

Format... , select highlighting of choice, OK , OK .

Repeat for the other three colours, adjusting the text and formatting to suit.

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