Conditional formatting of duplicate numbers with leading zeros

KBBersch

New Member
Joined
May 31, 2017
Messages
3
I have a spreadsheet to keep track of lab equipment. I have the Serial Number column set to find duplicates and highlight them with a red background. The entire column has the cells formatted as TEXT. I just came across a problem with two separate items that show as duplicates. For the first the serial number is 2, for the second the serial number is 002. The two are highlighted as duplicates of each other. I had expected that, with the cells formatted as Text, they would appear as different values but that is not the case. Any ideas on how to work around this shortcoming in Excel?

There was a thread on this a couple of years ago but it kind of petered out with no solution.

Thanks.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
The reason is because excel looks at the Integer of 001, 01, and 1 all as 1 which is the same number. If it is possible, you could create a helper column using CONCATENATE and conditionally format the duplicates there.

In Column B use
Code:
=CONCATENATE(A2,".",C2)
And copy down. You could then take your Conditional Formatting and base it off Column B rather than A.

For example;

A
B
C
1Part Number
Part ID
Part Name
2
001
001.ABC
ABC
3
01
01.BCD
BCD
4
1
1.CDE
CDE
5
2
2.DEF
DEF

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,497
Members
448,967
Latest member
visheshkotha

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