Duplicate values

shaggy31

Board Regular
Joined
May 6, 2009
Messages
64
Office Version
  1. 365
Platform
  1. Windows
Hi,

I need help regarding marking duplicate values in Excel. I know for Conditional formatting and highlighting duplicate values but I have one more condition so I don't know how to resolve it.

I have a table in which I keep data of devices that came into our service center. The data consists of income date, serial number, description, etc.
Now I would like to track and highlight the device (serial number) if it has come back to the center in the last six months (for example, we will see maybe it will be some different period but it doesn't matter for the question).

The table looks something like this:

Receive dateSerial No.ClientDescription...
1.1.2023
YYYYYYYYYYClient1sdfsdsd...
14.1.2023
XXXXXXXXXXClient2trettrgfd...
28.2.2023​
ZZZZZZZZZZClient3gfdgfdgfdg...
1.3.2023​
AAAAAAAAAAClient4ghfgh5hfg...
1.3.2023​
NNNNNNNNNClient2fgfdgbfdb...
14.5.2023​
PPPPPPPPPClient5fgfdgdgdg...
10.6.2023
YYYYYYYYYYClient1fgfdgfdgfdgfd...
7.7.2023
XXXXXXXXXXClient2fgfdgdgfdg...
...............

In this example, the Serial number XXXXXXXXX should be highlighted because it was received again in the last six months, but YYYYYYYY shouldn't be because it has past six months.

Best regards,
Shaggy
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
How are you calculating 6 months? The difference between 7 July and 14 Jan is 174 days while the difference between 10 Jun and 1 Jan is 160 days, but the first one counts while the second one does not?
 
Upvote 0
Sorry, for YYYYYYYYY it should be 10 July as a second date. My mistake.
It should be counting calendar days.
 
Upvote 0
In that case, try this
Book12
ABCDE
1Receive dateSerial No.ClientDescription...
201-Jan-23YYYYYYYYYYClient1sdfsdsd...
314-Jan-23XXXXXXXXXXClient2trettrgfd...
428-Feb-23ZZZZZZZZZZClient3gfdgfdgfdg...
501-Mar-23AAAAAAAAAAClient4ghfgh5hfg...
601-Mar-23NNNNNNNNNClient2fgfdgbfdb...
714-May-23PPPPPPPPPClient5fgfdgdgdg...
810-Jul-23YYYYYYYYYYClient1fgfdgfdgfdgfd...
907-Jul-23XXXXXXXXXXClient2fgfdgdgfdg...
10...............
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B9Expression=COUNTIFS($B$2:$B$9,B2,$A$2:$A$9,">="&EDATE(A2,-6),$A$2:$A$9,"<"&A2)textNO
 
Upvote 0
Solution
In that case, try this
Book12
ABCDE
1Receive dateSerial No.ClientDescription...
201-Jan-23YYYYYYYYYYClient1sdfsdsd...
314-Jan-23XXXXXXXXXXClient2trettrgfd...
428-Feb-23ZZZZZZZZZZClient3gfdgfdgfdg...
501-Mar-23AAAAAAAAAAClient4ghfgh5hfg...
601-Mar-23NNNNNNNNNClient2fgfdgbfdb...
714-May-23PPPPPPPPPClient5fgfdgdgdg...
810-Jul-23YYYYYYYYYYClient1fgfdgfdgfdgfd...
907-Jul-23XXXXXXXXXXClient2fgfdgdgfdg...
10...............
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B9Expression=COUNTIFS($B$2:$B$9,B2,$A$2:$A$9,">="&EDATE(A2,-6),$A$2:$A$9,"<"&A2)textNO
Thanks!
I don't know if I'm doing it right. I copied your formula in Conditional Formatting Rules Manager like this, but for some reason, it doesn't work.

1693386005408.png


1693385827859.png


If I write a formula without quotes I receive an error message.

1693386215618.png




It is possible that I'm doing something wrong.
 
Last edited:
Upvote 0
"">="" should just be ">=" and ""<"" should just be "<"
Wrapping the whole formula without quotes just makes it a text string, which does not help you in any way.

Additionally, I would expect the "Applies to" area to be the same height as your formula (i.e. 2:1000), unless there's something strange about your layout.
 
Upvote 0
"">="" should just be ">=" and ""<"" should just be "<"
Wrapping the whole formula without quotes just makes it a text string, which does not help you in any way.

Additionally, I would expect the "Applies to" area to be the same height as your formula (i.e. 2:1000), unless there's something strange about your layout.
That's it, thank you...

Just one more question.
Excel has a limitation of 15 characters when comparing. Is there a way to increase this limit to 25 characters, because I have a situation where some devices have SN with more than 20 characters and in this case, Excel shows them as duplicate values because the first 15 characters are the same, but the rest isn't.
 
Upvote 0
I'm assuming you're working with numbers here? Converting the cell range's format to Text BEFORE inputting the serial numbers will allow you to retain more than 15 digits.
 
Upvote 0
Cells are formated as Text but never the less Excel compares only first 15 characters...
 
Upvote 0
It's too late for the data you have already entered into excel; it would have already converted your digits after the 15th place into zeroes. You need to format the cell as text and re-input those numbers.
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,031
Members
449,092
Latest member
ikke

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