Conditional Formatting Question

Mitch21

New Member
Joined
May 2, 2018
Messages
14
Hello,

I want to conditionally format the highest value in a row. However, I only want to highlight the most recent occurrence of that value. For instance, in the table below, I only want to highlight the 6 that occurred on 4/21/2018, not the one that occurred on 3/31.

When I try to write a formula to conditionally format, it highlights both instances. Can anyone help?

[TABLE="width: 500"]
<tbody>[TR]
[TD]4/28/2018[/TD]
[TD]4/21/2018[/TD]
[TD]4/14/2018[/TD]
[TD]4/7/2018[/TD]
[TD]3/31/2018[/TD]
[TD]3/24/2018[/TD]
[TD]3/17/2018[/TD]
[TD]3/10/2018[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Can anyone help me understand how I would now also highlight the second highest number in that row a different color? In this circumstance, say I wanted the 5 in row D to be blue?
 
Upvote 0
Can anyone help me understand how I would now also highlight the second highest number in that row a different color? In this circumstance, say I wanted the 5 in row D to be blue?
1. There were two 6's and one 5 in that sample data. Do you only want the 5 highlighted and neither of the 6's?

2. What if, as well as the two 6's, there was three 5's in the range - what, exactly, should be highlighted?
 
Upvote 0
1. I would want the 6 to remain highlighted yellow, but the 5 to be highlighted blue
2. If there were three 5's, I would want the FIRST 5 to be highlighted, the same that we had originally done with the 6's
 
Upvote 0
OK, try this.

Excel Workbook
ABCDEFGH
128/04/201821/04/201814/04/20187/04/201831/03/201824/03/201817/03/201810/03/2018
256456434
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A21. / Formula is =AND(A2=MAX(IF($A2:$H2Abc
A22. / Formula is =AND(A2=MAX($A2:$H2),COUNTIF(A2:$H2,A2)=1)Abc
 
Last edited:
Upvote 0
That is VERY close. I should have been more specific. I would only want a 5 to be highlighted in Blue if it occurred BEFORE the 6 (by date). So in the example you put, none of the 5's would be highlighted. But, if a 5 occurred on 17/03/2018, it would be highlighted. Is that more clear?
 
Upvote 0
Is that more clear?
Yes. Just insert this extra bit into the 'blue' formula

AND(A2=MAX(IF($A2:$H2<MAX($A2:$H2),$A2:$H2)),COUNTIF(A2:$H2,">="&A2)=1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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