Highlight cells if column contains a given number X times
-
27-10-2019 - |
Question
I have a large Excel spreadsheet with a column that has an identifying number. Each unique number will occur at least 12 times. I would like to highlight those numbers that appear more than 12 times. Is there a way to do this non-programmatically?
Solution
Use Conditional Formatting:
=COUNTIF(INDIRECT(ADDRESS(1,COLUMN())&":"&
ADDRESS(65536,COLUMN())),INDIRECT(ADDRESS(ROW(), COLUMN())))>=12
Select the entire sheet, then choose Conditional Formatting. Apply this formula, and pick the formatting you'd like. It will work for any cell, in any column.
OTHER TIPS
Suppose in column A you have all your numbers. Then to highlight values that occur more than 12 times do as follows:
- Format > Conditional Formatting...
- In first dropdown select Formula Is
- In the adjacent box type
=COUNTIF(A:A, A1) > 12
- Now select the desired color to highlight
Does this help?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow