Conditional formatting (top/bottom) for visible cells only

rrandall

New Member
Joined
Feb 23, 2009
Messages
2
This is my first post, I have been able to leverage prior posts for other questions, but I can't seem to find anything that addresses the following:

I am trying to use a top 5 / bottom 5 conditional reporting for data that has several regions and I would like to highlight the top/bottom 5 for only the visible cells when filtering by region.

Any thoughts?
 
Perhaps you can work with an approach along the lines of:

Excel Workbook
ABCDE
1RegionValueVis_ValueTop n3
2a99**
3b77**
4c1313**
5a1010**
6a1515**
7b1212**
8b11**
9c99**
10a55**
11a77**
12b1212**
13c1414**
14a55**
15b55**
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C21. / Formula is =COUNTIF($C$2:$C$15,">"&$C2)<$E$1Abc


and the same with an "after" shot - ie to show the same but with filter applied:

<b>Sheet3</b><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:66px;" /><col style="width:64px;" /><col style="width:85px;" /><col style="width:64px;" /><col style="width:64px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td >*</td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td >Region</td><td >Value</td><td >Vis_Value</td><td >Top n</td><td style="text-align:right; ">3</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="background-color:#ffc000; ">a</td><td style="background-color:#ffc000; text-align:right; ">9</td><td style="background-color:#ffc000; text-align:right; ">9</td><td >*</td><td >*</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="background-color:#ffc000; ">a</td><td style="background-color:#ffc000; text-align:right; ">10</td><td style="background-color:#ffc000; text-align:right; ">10</td><td >*</td><td >*</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="background-color:#ffc000; ">a</td><td style="background-color:#ffc000; text-align:right; ">15</td><td style="background-color:#ffc000; text-align:right; ">15</td><td >*</td><td >*</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >10</td><td >a</td><td style="text-align:right; ">5</td><td style="text-align:right; ">5</td><td >*</td><td >*</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >11</td><td >a</td><td style="text-align:right; ">7</td><td style="text-align:right; ">7</td><td >*</td><td >*</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >14</td><td >a</td><td style="text-align:right; ">5</td><td style="text-align:right; ">5</td><td >*</td><td >*</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >15</td><td >b</td><td style="text-align:right; ">5</td><td style="text-align:right; ">5</td><td >*</td><td >*</td></tr></table>

It follows that the same logic can be applied to bottom n values... and column C need not be visible of course.
 
Upvote 0
ignore the * ... these equate to blank cells
(I had the audacity to preview the post at which point everything goes a little haywire)

note also that E1 is a variable - ie changing this number will alter how many values are highlighted - ie top n values.
 
Upvote 0
Smart and simple solution. Works perfectly and managing the # of items as a variable is win as well.

Thank you & cheers!
 
Upvote 0

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