Conditional format the top x non zero values by column

John_Whin

Board Regular
Joined
Feb 26, 2013
Messages
78
Platform
  1. Windows
I don't know how to use an IF to select non zero values only for conditional formatting.

Ideally want to highlight the top x non zero values in column B only, then highlight top x non zero in column C only etc. Would like to do this across multiple columns.

Thanks
 
I did not exactly understand where to put your formula, and was away for a few days. Right now the new problem is more important. I can live without the conditional formatting nicety better than I can this problem.

Thanks to you both for the help. I really appreciate it.
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
OK, now the second problem is corrected please lets start fresh. Cells F3:AL30 do not have any conditional formatting. Those cells are populated by a COUNTIFS function. So I'm going to the Penalty Input sheet, using the player name to count the occurrences of each Penalty type.

Exactly how do I format the columns to highlight the top 3 values in each column while ignoring values of zero? Is there a direct way to do this using Conditional Formatting or do I need to nest the COUNTIFS in an IF statement that says if the result of the COUNTIFS function > 0 then COUNTIFS result is applied, else then have an empty cell?

Sorry for the large image, screenshot from 4K monitor.

24m714y.jpg
 
Upvote 0
Ok, if this is what you want to see


Excel 2013/2016
FGHIJ
1
2
310140
400000
511200
601100
700000
800001
900000
1000000
1100001
1210300
1300030
1400100
1500110
1611200
1700000
1800000
1900200
2000000
2100100
2200000
2300050
2410200
2500020
2600000
2700000
2800000
2900000
3000100
Ramp


Select F3:AL30 > Conditional Formatting > New Rule > use a formula > enter =AND(F3<>0,(SUMPRODUCT(1-(F$3:F$30=0),--(F$3:F$30 > F3))+1) < 4) > select format > ok
 
Upvote 0
Leaving for a while, that is exactly what I want to do. Will work on it later.
Thanks
 
Upvote 0
Works perfectly, just what I counted on from this forum's expertise.

Thank you very much Fluff. Wish your next pint could be on me.
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0
Works perfectly,
In that case it looks like you could also use this

Excel Workbook
FGHIJ
1
2
310140
400000
511200
601100
700000
800001
900000
1000000
1100001
1210300
1300030
1400100
1500110
1611200
1700000
1800000
1900200
2000000
2100100
2200000
2300050
2410200
2500020
2600000
2700000
2800000
2900000
3000100
CF Top 3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F31. / Formula is =AND(F3<>0,F3>=LARGE(F$3:F$30,3))Abc
 
Upvote 0

Forum statistics

Threads
1,214,853
Messages
6,121,935
Members
449,056
Latest member
denissimo

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