简体   繁体   中英

Conditional formatting formula/vba

I have the following table where people are in either group 1 or 2 or 3.

在此处输入图片说明

What I want is to format (highlight) x differently when one person is in more than one group on one day. Is there any possibility to do this neatly without vba based on formulae only? If vba I do not have a nice idea how to approach this without simply browsing the entire table. How should I approach that?

To achieve this with the help of the conditional formatting, follow these steps...

  1. Select the whole columns B:C.
  2. Home --> Conditional Formatting --> New Rule --> Use a formula to determine which cells to format --> in the box below "Format values where this formula is true", paste the formula given below
  3. Click on Format --> Font --> Choose the Bold italic and set the font color to red or as per your choice --> OK --> OK to finish.

Formula for conditional formatting:

=AND(B1="x",COUNTIFS($A:$A,$A1,B:B,"x")>1)

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