Share via

Conditional formatting

Anonymous
2024-10-07T06:52:56+00:00

I have the following:

I want to format A1:B5 if a value in A1:B5 is equal to a value in D1:D5. No formatting if there are duplicates in A1:B5. In above example only cell A5 should be formatted (not cells with the value 99).

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2024-10-07T15:26:51+00:00
=and(countif($A$1:$B$5,A1)=1,countif($D$1:$D$5,A1)=1)

This does seem to check for "No formatting if there are duplicates in A1:B5" but also seems to check for duplicates in D1:D5.

Why isn't A5 highlighted here:?

Image

I would put forward:

=AND(COUNTIF($A$1:$B$5,A1)=1,COUNTIF($D$1:$D$5,A1)>0)

which yields:

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2024-10-07T07:06:26+00:00

Select A1:B5 and set as conditional format:

=and(countif($A$1:$B$5,A1)=1,countif($D$1:$D$5,A1)=1)

Then, not only A5 but also B3 will be formatted.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-10-07T15:43:27+00:00

    Good catch p45cal. Thank you.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-10-07T07:22:13+00:00

    Thank you very much aalpha and of course you are right about cell B3.

    Was this answer helpful?

    0 comments No comments