Highlight duplicates cells, but ignore cells with a ?

bhsoundman

Board Regular
Joined
Jul 17, 2010
Messages
50
Office Version
  1. 365
Platform
  1. MacOS
I've basically got a column of names. I want to highlight duplicates. Conditional formatting works well, but but many cells in the column = "?" as a place holder. Obviously this will get flagged as a duplicate as well, but I want to take any cells that = "?" out of the running. So, basically with the exception of cells that = "?" I want to highlight duplicates. I'm fine with a VBA macro, just was trying to use a build in tool. Any ideas?

Thanks!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
countifs( range, "<>"?",range, cell)
in a conditional formatting
=COUNTIFS($A$2:$A$21,$A2,$A$2:$A$21,"<>?")>1

Book9
A
2name1
3name2
4name3
5?
6name5
7name6
8name7
9?
10name1
11?
12name3
13?
14name5
15?
16name7
17name16
18name17
19name18
20name19
21name20
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A21Expression=COUNTIFS($A$2:$A$21,$A2,$A$2:$A$21,"<>?")>1textNO



Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
 
Upvote 0
Solution
countifs( range, "<>"?",range, cell)
in a conditional formatting
=COUNTIFS($A$2:$A$21,$A2,$A$2:$A$21,"<>?")>1

Book9
A
2name1
3name2
4name3
5?
6name5
7name6
8name7
9?
10name1
11?
12name3
13?
14name5
15?
16name7
17name16
18name17
19name18
20name19
21name20
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A21Expression=COUNTIFS($A$2:$A$21,$A2,$A$2:$A$21,"<>?")>1textNO



Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Thanks so much etaf! This works perfectly!!
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,135
Members
453,021
Latest member
Justyna P

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