Duplicate in different cells

JAWS1

New Member
Joined
Oct 22, 2017
Messages
19
I have a large spreadsheet with duplicate entries adjacent on 2 rows is there a formula for this they are marriages and need pairing up as you can see from the reference numbers on right side are the same that I have edited. They are in pairs with the same reference
[TABLE="width: 769"]
<colgroup><col><col><col><col><col span="3"><col><col><col></colgroup><tbody>[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1858[/TD]
[TD] GREEN[/TD]
[TD]William[/TD]
[TD]SHERRNGTON[/TD]
[TD]Jane[/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]121[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1858 [/TD]
[TD]SHERRNGTON[/TD]
[TD]Jane[/TD]
[TD]GREEN[/TD]
[TD]William[/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]121[/TD]
[/TR]
[TR]
[TD="align: right"]28[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1858[/TD]
[TD] DARBYSHIRE[/TD]
[TD]Leigh[/TD]
[TD]ARMSTEAD[/TD]
[TD]Elizabeth[/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]122[/TD]
[/TR]
[TR]
[TD="align: right"]28[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1858[/TD]
[TD] ARMSTEAD[/TD]
[TD]Elizabeth[/TD]
[TD]DARBYSHIRE[/TD]
[TD]Leigh[/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]122[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1858[/TD]
[TD]GREGORY[/TD]
[TD]William[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]123[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1858[/TD]
[TD]DEAN[/TD]
[TD]Jane[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]123[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1858[/TD]
[TD]SMITH[/TD]
[TD]Peter[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]125[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1858[/TD]
[TD]PARKINSON[/TD]
[TD]Elizabeth[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]125[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1858[/TD]
[TD]BENNISON[/TD]
[TD]William[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]126[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1858[/TD]
[TD]THOMPSON[/TD]
[TD]Ann[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]126[/TD]
[/TR]
[TR]
[TD="align: right"]29[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1858[/TD]
[TD]WOOD[/TD]
[TD]James[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]127[/TD]
[/TR]
[TR]
[TD="align: right"]29[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1858[/TD]
[TD]LEIGH[/TD]
[TD]Margaret[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]127[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]1858[/TD]
[TD]KENYON[/TD]
[TD]Ralph[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]128[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]1858[/TD]
[TD]HUNTER[/TD]
[TD]Ellen[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]128[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]1858[/TD]
[TD]ASHTON[/TD]
[TD]Joseph[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]129[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]1858[/TD]
[TD]GREGORY[/TD]
[TD]Jane[/TD]
[TD][/TD]
[TD][/TD]
[TD]C29[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]129[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Considering your list starts from an even row, try this in the first cell next to William GREEN.
Copy across and down.

Code:
[TABLE="width: 64"]
<tbody>[TR]
  [TD="width: 64"]=IF(ISEVEN(ROW()),OFFSET(E2,1,0),OFFSET(E2,-1,0))[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I can offer you either a set of formulae which need to be selected as a block and then dragged down the two columns, or you could run a macro which I've supplied below.

Excel 2013/2016
ABCDEFGHIJ
11421858GREENWilliamSHERRNGTONJaneC291121
21421858SHERRNGTONJaneGREENWilliamC291121
32821858DARBYSHIRELeighARMSTEADElizabethC291122
42821858ARMSTEADElizabethDARBYSHIRELeighC291122
5831858GREGORYWilliamDEANJaneC291123
6831858DEANJaneGREGORYWilliamC291123
71531858SMITHPeterPARKINSONElizabethC291125
81531858PARKINSONElizabethSMITHPeterC291125
92031858BENNISONWilliamTHOMPSONAnnC291126
102031858THOMPSONAnnBENNISONWilliamC291126
112931858WOODJamesLEIGHMargaretC291127
122931858LEIGHMargaretWOODJamesC291127
13341858KENYONRalphHUNTEREllenC291128
14341858HUNTEREllenKENYONRalphC291128
15441858ASHTONJosephGREGORYJaneC291129
16441858GREGORYJaneASHTONJosephC291129
Sheet1
Cell Formulas
RangeFormula
F1=D2
F2=D1
G1=E2
G2=E1


Code:
Sub MarriagePairs()
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Dim a As Long
For a = 1 To lastrow Step 2
Range("D" & a + 1 & ":E" & a + 1).Copy
Range("F" & a).PasteSpecial
Range("D" & a & ":E" & a).Copy
Range("F" & a + 1).PasteSpecial
Next
End Sub
 
Upvote 0
Thanks the macro worked perfectly it did 13,000 entries in less than 3 minutes thank you .you are a star.
 
Upvote 0
Thank you, you're welcome.

Three minutes? I had no idea of timing.

Upon reflection I should have included :
Application.Screenupdating=false
Application.Calculation= xlCalculationManual
as the first two lines
and
Application.Screenupdating=True
Application.Calculation= xlCalculationAutomatic
as the last two.

That would have made the run somewhat faster.
 
Upvote 0
Not bothered about the timing only too glad that I have a macro to sort the indexes out have done another 100,000 since thank you very much made an old man happy.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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