I previously had help with writing a macro to eliminate duplicate
records, and it worked great which told me there are two duplicate
records. Now I need to quickly identify them.

There is one column of numbers, sorted in numeric order. I just need
to place an X
in a helper column for each duplicate record so I can then sort by the
helper column. Basically for this to be fast, I just want to compare
one cell with the one above it. I've yet to figure out how to do
that. Any help appreciated! I've googled up a storm and all I'm
finding is deleting dupes or placing an X in a helper column but
comparing all records in column A which will take too long with
300,000 records.

Thanks!

Re: locating duplicate records in a 300,000 record file by JP

JP
Fri Mar 14 17:28:56 CDT 2008

What Excel version do you have? I assume 2007, because you can't have
300k rows in any other version.

Let's say your data runs from A2:A300000 (with header in A1)

Column B will be the helper column. Starting from B3, enter this
formula:

=3DIF(COUNTIF(A2:A3,A3)=3D1,"X","")

Fill down and then Copy>Paste values. Any cell with an "X" has a
duplicate in the cell immediately above the corresponding cell in
column A. For example if A3 and A4 were dupes, cell B4 would have an
"X" in it.

Keep in mind this won't catch dupes found elsewhere in the range.

HTH,
JP

On Mar 14, 5:53=A0pm, robro <rrothb...@gmail.com> wrote:
> I previously had help with writing a macro to eliminate duplicate
> records, and it worked great which told me there are two duplicate
> records. =A0Now I need to quickly identify them.
>
> There is one column of numbers, sorted in numeric order. =A0I just need
> to place an X
> in a helper column for each duplicate record so I can then sort by the
> helper column. =A0Basically for this to be fast, I just want to compare
> one cell with the one above it. =A0I've yet to figure out how to do
> that. =A0Any help appreciated! =A0I've googled up a storm and all I'm
> finding is deleting dupes or placing an X in a helper column but
> comparing all records in column A which will take too long with
> 300,000 records.
>
> Thanks!


RE: locating duplicate records in a 300,000 record file by BillyLiddel

BillyLiddel
Fri Mar 14 17:34:02 CDT 2008

Robro

Sub MarkDupes()
'Assumes data in column A ' Adjust to suit
Dim i As Long, nr As Long
Range("A1").Select
nr = ActiveCell.CurrentRegion.Rows.Count
For i = 2 To nr
If Cells(i, 1) = Cells(i - 1, 1) Then
Cells(i, 2) = "X"
End If
Next i
End Sub

Will mark cells in column b

Peter

"robro" wrote:

> I previously had help with writing a macro to eliminate duplicate
> records, and it worked great which told me there are two duplicate
> records. Now I need to quickly identify them.
>
> There is one column of numbers, sorted in numeric order. I just need
> to place an X
> in a helper column for each duplicate record so I can then sort by the
> helper column. Basically for this to be fast, I just want to compare
> one cell with the one above it. I've yet to figure out how to do
> that. Any help appreciated! I've googled up a storm and all I'm
> finding is deleting dupes or placing an X in a helper column but
> comparing all records in column A which will take too long with
> 300,000 records.
>
> Thanks!
>

Re: locating duplicate records in a 300,000 record file by robro

robro
Fri Mar 14 17:42:04 CDT 2008

Thanks for both responses. I guess my first macro did something odd
because using this method, there are no duplicates.
Damn, I'm trying to figure out why a SQL data import is crashing with
duplicate errors and my SQL guy is unavailable so
I'm resorting to guessing and using Excel (yes Excel 2007, I was very
excited to find it could handle so many rows when
it first came out. That was one of the first features I checked for).


On Mar 14, 6:34 pm, Billy Liddel
<BillyLid...@discussions.microsoft.com> wrote:
> Robro
>
> Sub MarkDupes()
> 'Assumes data in column A ' Adjust to suit
> Dim i As Long, nr As Long
> Range("A1").Select
> nr = ActiveCell.CurrentRegion.Rows.Count
> For i = 2 To nr
> If Cells(i, 1) = Cells(i - 1, 1) Then
> Cells(i, 2) = "X"
> End If
> Next i
> End Sub
>
> Will mark cells in column b
>
> Peter
>
> "robro" wrote:
> > I previously had help with writing a macro to eliminate duplicate
> > records, and it worked great which told me there are two duplicate
> > records. Now I need to quickly identify them.
>
> > There is one column of numbers, sorted in numeric order. I just need
> > to place an X
> > in a helper column for each duplicate record so I can then sort by the
> > helper column. Basically for this to be fast, I just want to compare
> > one cell with the one above it. I've yet to figure out how to do
> > that. Any help appreciated! I've googled up a storm and all I'm
> > finding is deleting dupes or placing an X in a helper column but
> > comparing all records in column A which will take too long with
> > 300,000 records.
>
> > Thanks!


Re: locating duplicate records in a 300,000 record file by Pete_UK

Pete_UK
Fri Mar 14 18:25:04 CDT 2008

Why not sort the data first and then put this in B2:

=3DIF(A1=3DA2,"X","")

and copy down? Then apply a filter to column B to locate all the X's
(duplicates).

Hope this helps.

Pete

On Mar 14, 10:42=A0pm, robro <rrothb...@gmail.com> wrote:
> Thanks for both responses. =A0I guess my first macro did something odd
> because using this method, there are no duplicates.
> Damn, I'm trying to figure out why a SQL data import is crashing with
> duplicate errors and my SQL guy is unavailable so
> I'm resorting to guessing and using Excel (yes Excel 2007, I was very
> excited to find it could handle so many rows when
> it first came out. =A0That was one of the first features I checked for).
>
> On Mar 14, 6:34 pm, Billy Liddel
>
>
>
> <BillyLid...@discussions.microsoft.com> wrote:
> > Robro
>
> > Sub MarkDupes()
> > 'Assumes data in column A ' Adjust to suit
> > Dim i As Long, nr As Long
> > Range("A1").Select
> > nr =3D ActiveCell.CurrentRegion.Rows.Count
> > =A0 For i =3D 2 To nr
> > =A0 =A0 If Cells(i, 1) =3D Cells(i - 1, 1) Then
> > =A0 =A0 =A0 Cells(i, 2) =3D "X"
> > =A0 =A0 End If
> > =A0 Next i
> > End Sub
>
> > Will mark cells in column b
>
> > Peter
>
> > "robro" wrote:
> > > I previously had help with writing a macro to eliminate duplicate
> > > records, and it worked great which told me there are two duplicate
> > > records. =A0Now I need to quickly identify them.
>
> > > There is one column of numbers, sorted in numeric order. =A0I just nee=
d
> > > to place an X
> > > in a helper column for each duplicate record so I can then sort by the=

> > > helper column. =A0Basically for this to be fast, I just want to compar=
e
> > > one cell with the one above it. =A0I've yet to figure out how to do
> > > that. =A0Any help appreciated! =A0I've googled up a storm and all I'm
> > > finding is deleting dupes or placing an X in a helper column but
> > > comparing all records in column A which will take too long with
> > > 300,000 records.
>
> > > Thanks!- Hide quoted text -
>
> - Show quoted text -


Re: locating duplicate records in a 300,000 record file by T

T
Fri Mar 14 22:06:59 CDT 2008

>Excel 2007

Assume the range is A1:A300000
Select the range A1:A300000
Goto Home tab>Styles>Conditional Formatting>New rule>Format only unique or
duplicate values

From the drop down select duplicate
Click the Format button
Select the desired style(s)
OK out

--
Biff
Microsoft Excel MVP


"robro" <rrothberg@gmail.com> wrote in message
news:eae0c1fb-3811-43de-9754-eb78d1c6b909@e25g2000prg.googlegroups.com...
> Thanks for both responses. I guess my first macro did something odd
> because using this method, there are no duplicates.
> Damn, I'm trying to figure out why a SQL data import is crashing with
> duplicate errors and my SQL guy is unavailable so
> I'm resorting to guessing and using Excel (yes Excel 2007, I was very
> excited to find it could handle so many rows when
> it first came out. That was one of the first features I checked for).
>
>
> On Mar 14, 6:34 pm, Billy Liddel
> <BillyLid...@discussions.microsoft.com> wrote:
>> Robro
>>
>> Sub MarkDupes()
>> 'Assumes data in column A ' Adjust to suit
>> Dim i As Long, nr As Long
>> Range("A1").Select
>> nr = ActiveCell.CurrentRegion.Rows.Count
>> For i = 2 To nr
>> If Cells(i, 1) = Cells(i - 1, 1) Then
>> Cells(i, 2) = "X"
>> End If
>> Next i
>> End Sub
>>
>> Will mark cells in column b
>>
>> Peter
>>
>> "robro" wrote:
>> > I previously had help with writing a macro to eliminate duplicate
>> > records, and it worked great which told me there are two duplicate
>> > records. Now I need to quickly identify them.
>>
>> > There is one column of numbers, sorted in numeric order. I just need
>> > to place an X
>> > in a helper column for each duplicate record so I can then sort by the
>> > helper column. Basically for this to be fast, I just want to compare
>> > one cell with the one above it. I've yet to figure out how to do
>> > that. Any help appreciated! I've googled up a storm and all I'm
>> > finding is deleting dupes or placing an X in a helper column but
>> > comparing all records in column A which will take too long with
>> > 300,000 records.
>>
>> > Thanks!
>



Re: locating duplicate records in a 300,000 record file by Shane

Shane
Sat Mar 15 10:03:34 CDT 2008

This is a multi-part message in MIME format.

------=_NextPart_000_0072_01C88673.1109E000
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

Since you are using 2007, if you want to remove the duplicates you can =
choose the command Data, Remove Duplicates. As already mentioned you =
can use conditional formatting to mark the duplicates. But with 300000 =
you may want to locate the found records quickly, so:

1. After applying the conditional format mentioned in a previous reply
2. Select the 300000 rows and choose the command Home, Sort & Filter, =
Custom Filter
3. In the Sort box under Sort by pick the column you want to sort on, =
under Sort on pick Cell Color, under Order select No Cell Color and On =
Bottom, then click OK.

This will put all the duplicates at the top.

Cheers,
Shane Devenshire
Microsoft Excel MVP


"robro" <rrothberg@gmail.com> wrote in message =
news:ac0e781d-8b81-4dd1-bcec-53de5a88cbe9@i7g2000prf.googlegroups.com...
> I previously had help with writing a macro to eliminate duplicateh
> records, and it worked great which told me there are two duplicate
> records. Now I need to quickly identify them.
>=20
> There is one column of numbers, sorted in numeric order. I just need
> to place an X
> in a helper column for each duplicate record so I can then sort by the
> helper column. Basically for this to be fast, I just want to compare
> one cell with the one above it. I've yet to figure out how to do
> that. Any help appreciated! I've googled up a storm and all I'm
> finding is deleting dupes or placing an X in a helper column but
> comparing all records in column A which will take too long with
> 300,000 records.
>=20
> Thanks!
------=_NextPart_000_0072_01C88673.1109E000
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dunicode">
<META content=3D"MSHTML 6.00.6000.16609" name=3DGENERATOR></HEAD>
<BODY id=3DMailContainerBody=20
style=3D"PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"=20
bgColor=3D#ffffff leftMargin=3D0 topMargin=3D0 CanvasTabStop=3D"true"=20
name=3D"Compose message area">
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Since you are using 2007, if you want =
to remove the=20
duplicates you can choose the command Data, Remove Duplicates.&nbsp; As =
already=20
mentioned you can use conditional formatting to mark the =
duplicates.&nbsp; But=20
with 300000 you may want to locate the found records quickly, =
so:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1. After applying the conditional =
format mentioned=20
in a previous reply</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2. Select the 300000 rows and choose =
the command=20
Home, Sort &amp; Filter, Custom Filter</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>3. In the Sort box under Sort by pick =
the column=20
you want to sort on, under Sort on pick Cell Color, under Order select =
No Cell=20
Color and On Bottom, then click OK.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This will put all the duplicates at the =

top.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Shane Devenshire</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Microsoft Excel MVP</FONT></DIV>
<DIV><BR><BR>"robro" &lt;rrothberg@gmail.com&gt; wrote in message=20
news:ac0e781d-8b81-4dd1-bcec-53de5a88cbe9@i7g2000prf.googlegroups.com...<=
BR>&gt;=20
I previously had help with writing a macro to eliminate =
duplicateh<BR>&gt;=20
records, and it worked great which told me there are two =
duplicate<BR>&gt;=20
records.&nbsp; Now I need to quickly identify them.<BR>&gt; <BR>&gt; =
There is=20
one column of numbers, sorted in numeric order.&nbsp; I just =
need<BR>&gt; to=20
place an X<BR>&gt; in a helper column for each duplicate record so I can =
then=20
sort by the<BR>&gt; helper column.&nbsp; Basically for this to be fast, =
I just=20
want to compare<BR>&gt; one cell with the one above it.&nbsp; I've yet =
to figure=20
out how to do<BR>&gt; that.&nbsp; Any help appreciated!&nbsp; I've =
googled up a=20
storm and all I'm<BR>&gt; finding is deleting dupes or placing an X in a =
helper=20
column but<BR>&gt; comparing all records in column A which will take too =
long=20
with<BR>&gt; 300,000 records.<BR>&gt; <BR>&gt; =
Thanks!</DIV></BODY></HTML>

------=_NextPart_000_0072_01C88673.1109E000--