Duplicate entries

pommesmitmayo

New Member
Joined
Jun 12, 2011
Messages
23
Hi all, hope well.

So I have had a look and seen Countif, orcountif etc etc and can't seem to see someone that has done this but at the same time as eluding me, it seems simple.
I have a simple sheet as attached that I want to use to manage job numbers.
The idea is that under one sales order there may be a number of jobs and each of these needs to be unique.

At the moment it's pretty manageable but as it gets longer I want employees to not have to search or filter to find out if a duplicate is present. At the moment I can only find solutions that refer to a duplicate of a value in a specific cell.

So in column B we have job numbers in cells B3 to Bx.
I'd like cell B1 to highlight if there is a duplicate anywhere in B3:Bx.

Can somebody point me in the right direction pls?

Book1.xlsx
ABCDEF
1
2Sales OrderJob NumberWorks dateClient
327764104/09/2018Lloyds
4204/09/2018Lloyds
527765323/11/2018Barclays
627766417/05/2019Halifax
727767521/05/2019HBOS
827768615/07/2019Nationwide
927769720/11/2019Natwest
1027770812/02/2020HSBC
1127771901/06/2020MBNA
12277721004/06/2020Capital One
13277731107/07/2020Lloyds
14277741224/11/2020JP Morgan
15277751308/05/2021Credit Suisse
16277761408/05/2021BNP Paribas
171507/07/2022BNP Paribas
18277771608/07/2022Halifax
19
20
21
22
Sheet1


That mini sheet Add in is BRILLIANT!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi Pomm...,

Considering you're concerned with identifying duplicates in a single column, using the default Conditional Formatting for Duplicates I think is a good first start.
You can select Column B > Conditional Formatting > Highlight Cell Rules > Duplicate Values...
Try that first to see if this is what you're looking for.
Book1
ABCD
1Sales OrderJob NumberWorks dateClient
227764104/09/2018Lloyds
327764204/09/2018Lloyds
427765323/11/2018Barclays
527766417/05/2019Halifax
627767521/05/2019HBOS
727768615/07/2019Nationwide
827769720/11/2019Natwest
927770812/02/2020HSBC
1027771901/06/2020MBNA
11277721004/06/2020Capital One
12277731107/07/2020Lloyds
13277741224/11/2020JP Morgan
14277751308/05/2021Credit Suisse
15277761408/05/2021BNP Paribas
16277761507/07/2022BNP Paribas
17277771608/07/2022Halifax
1816
192
20Total1616
Duplicates
Cell Formulas
RangeFormula
B20B20=SUBTOTAL(104,[Job Number])
D20D20=SUBTOTAL(103,[Client])
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B19Cell ValueduplicatestextNO


I formatted the data into a Table and then used the Totals Row at the bottom to show the Maximum number in Column B so you'll know what the Next Number should be.

However, a better solution would be to get help with some VBA code that would automatically populate the next value for you when a new Table Row is inserted so you don't have to enter it manually. You'll want to start a new Thread for that if that interests you.
 
Last edited:
Upvote 0
Hi Pomm...,

Considering you're concerned with identifying duplicates in a single column, using the default Conditional Formatting for Duplicates I think is a good first start.
You can select Column B > Conditional Formatting > Highlight Cell Rules > Duplicate Values...
Try that first to see if this is what you're looking for.
Hi *zero269, thanks for coming back to me so quickly.

I'd looked at that but its not quite the answer. The reason is this;
Some jobs span months so although the job numbers are in numerical order now they won't always be. The same applies to invoice numbers and certain other numbers that aren't shown.
The way I'd like it to be, (I've used the View menu and frozen the top two rows), is that even if we've opened the workbook and are woking on row 2500 we'll still see the top row and therefore if we use any reference twice, we get a highlight in the top cell.
I believe the usual way for the method you suggested will give no indication if that particular cell is not on screen at the time?
 
Upvote 0
Hi *zero269, thanks for coming back to me so quickly.

I'd looked at that but its not quite the answer. The reason is this;
Some jobs span months so although the job numbers are in numerical order now they won't always be. The same applies to invoice numbers and certain other numbers that aren't shown.
The way I'd like it to be, (I've used the View menu and frozen the top two rows), is that even if we've opened the workbook and are woking on row 2500 we'll still see the top row and therefore if we use any reference twice, we get a highlight in the top cell.
I believe the usual way for the method you suggested will give no indication if that particular cell is not on screen at the time?
EDIT: Also, I;ll duplicate this functionality to other columns at some stage.
 
Upvote 0
This might be a better option than the highlights...?
Hi *zero269, thanks for coming back to me again.

So, that's annoying as I'd seen that solution previously. What I should have done is actually tried it/watched the whole video. In that example, the formula used is;
=COUNTIF($A$1:$A$15,A1)=1
The mistake/oversight on my part was assuming that the validation would only apply to the value in A1 but the guy says that teh formula is effectively 'dynamic', in that in copies down and applies to all cell references.
Apologies for wasting your time.
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

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