highlight unique values in a column except "x" and "pp"

Victtor

Board Regular
Joined
Jan 4, 2007
Messages
170
Office Version
  1. 365
Platform
  1. Windows
I have numerical data in column F from F4 to F33. I have data also in column F from F35 to F50


I need the data in F35:F50 highlited if it does not appear in F4:F33


I will use the code or formula you provide to apply to the same cells in other columns.


for example if cell F35 has "2", but it there is no "2" in F4:F33, F35 should be highlighted. I understand that this part is easy, but I need the formula to omit empty cells and cells with "x" or "pp" in them.

Thanks in advance
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
if inderstand correctly this should be your conditional format rule

Code:
=AND(COUNTIF($F$4:$F$33,F35)=0,F35<>"",F35<>"pp",F35<>"x")
 
Last edited:
Upvote 0
PHP:
=AND(COUNTIF($F$4:$F$33,F35)=0,ISERROR(SEARCH("x",F35)),ISERROR(SEARCH("pp",F35)))
 
Upvote 0
if inderstand correctly this should be your conditional format rule

Code:
=AND(COUNTIF($F$4:$F$33,F35)=0,F35<>"",F35<>"pp",F35<>"x")

Ok,thanks, need a little more tweaking. This highlights cells with duplicate values, I need only the cells in F35:F50 highlited if that is a unique value
 
Upvote 0
Ok,thanks, need a little more tweaking. This highlights cells with duplicate values, I need only the cells in F35:F50 highlited if that is a unique value

i missed that part, try this

=AND(COUNTIF($F$4:$F$33,F34)=0,F34<>"",F34<>"pp",F34<>"x",COUNTIF($F$35:$F$50,F35)=1)
 
Upvote 0
i missed that part, try this

=AND(COUNTIF($F$4:$F$33,F34)=0,F34<>"",F34<>"pp",F34<>"x",COUNTIF($F$35:$F$50,F35)=1)



So, what should be happening is that the nonempty cells F35-F50 should be highlighted because they should start out as unique values. As I input values in cells F4-F34 (that equal the unique values in F34-F50), The values in F34-F50 should "unhighlight" because they are no longer unique values.

For example: There is a "1" in F40 (This should automatically be highlighted since it is a unique value). If I use that "1" on, say, cell F16, then F40 should "unhighlight" because it is no longer a unique value
 
Upvote 0
maybe post a sample of your data with expected results to avoid confusion?


Still working on a way to post data. Meanwhile....

Ok, I got this far with just using Excel tools (conditional formatting):

Sub ExampleTest()

Columns("F:F").Select
Selection.FormatConditions.AddUniqueValues
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).DupeUnique = xlUnique
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub


I need to do 2 things with this:

1. Write this code to evaluate each column separately (Columns F through AG), meaning I can have a "1" in Column F and Column G and they both be considered unique values for their columns
2. Perhaps make a combo button to toggle this formatting on and off?

Any help would be appreciated and thanks in advance
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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