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?

4/28/20184/21/20184/14/20184/7/20183/31/20183/24/20183/17/20183/10/2018
46456434

<tbody>
</tbody>
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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