Conditional Formatting

bpmurphy

New Member
Joined
Feb 12, 2013
Messages
8
Hello all, I am trying to conditionally format the "Completed?" column based on criteria. If "Completed?" equals N but ONLY if there isn't another row with the same Acct # and a completed of Y. So for the example below Acct # 12345 shows up multiple times but Completed should NOT be highlighted because the third entry for that acct # is Y. Similarly, for acct # 30121 it should be highlighted for N because it's the only entry. Any ideas? Appreciate the help!

[TABLE="width: 200"]
<tbody>[TR]
[TD]Acct #[/TD]
[TD]Accts[/TD]
[TD]Completed?[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]2[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]1[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]12345[/TD]
[TD]3[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]30121[/TD]
[TD]1[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]20984[/TD]
[TD]1[/TD]
[TD]Y[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Re: Conditional Formatting Help

Try... (assuming you're in cell C3)
Code:
=AND($C3="N",COUNTIFS($A,$A3,$C,"<>N")>0)
 
Last edited:
Upvote 0
Re: Conditional Formatting Help

=and(c2="n",countifs($a$2:$a$6,a2,$c$2:$c$6,"y")=0)
 
Upvote 0
Re: Conditional Formatting Help

Try
=AND($C5="N",COUNTIFS($A:$A,$A5,$C:$C,"<>N")=0)
All you need to do is create the formula in a column and then transfer it to the conditional formatting box.
 
Upvote 0
Re: Conditional Formatting Help

Thanks for the ideas, I played around with both your formulas and managed to get it to work as a 1,0 output. Used the conditions of 1 as formatted and 0 as non. Appreciate the help!
 
Upvote 0
Re: Conditional Formatting Help

Goodo. if you're doing anything fancy with conditional formats with formulae, it's always worth doing it in additional columns or rows to make use it does what you want then transfer it to the conditional formatting.

Just remember to use as many brackets as possible, later versions of Excel are more forgiving but earlier ones needed brackets everywhere to force it to calculate true or false, even on something like =(A5=10).
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top