Formula: Need to select a duplicate occurrence based upon other row values

dbiss

New Member
Joined
Sep 12, 2017
Messages
3
I need a formula to identify or select a single occurrence of a duplicate value based upon values in other columns of each row. For instance, in the table below, I would want to select the instance in A4- where none of the other row values were blank. Any advice is appreciated.

ABCDEF
1IDCOLORTEMPStartDateEndDateY/N
2123ABCgreenhot1/1/2017Y
3123ABC1/1/2017Y
4123ABCgreenhot1/1/20171/31/2017Y
5123ABChot1/1/2017
6123ABChot1/1/2017Y
7123ABCgreen1/1/20171/31/2017
8123ABC1/1/2017Y
9123ABChot1/1/2017Y

<tbody>
</tbody>
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
but row 4 is not a duplicate value as there are no identical rows with non blanks - please clarify
 
Upvote 0
but row 4 is not a duplicate value as there are no identical rows with non blanks - please clarify

Please consider "ID" (column A) the key value, which is the same in every row shown. I need to be able to select the instance of the key value based upon the values in the other columns; in this case wherein all of the other columns in that row have a value. Thanks.
 
Upvote 0
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 12/09/2017 by bob
'


'
rrow = 39
For k = 1 To 2
Match = Cells(k + 32, 1)
For j = 2 To 26
If Cells(j, 1) = Match Then GoTo 20 Else GoTo 50
20 If Cells(j, 2) <> "" And Cells(j, 3) <> "" And Cells(j, 4) <> "" Then GoTo 40 Else GoTo 50
40 If Cells(j, 5) <> "" And Cells(j, 6) <> "" Then GoTo 45 Else GoTo 50
45 rrow = rrow + 1
For z = 1 To 7
Cells(rrow, z) = Cells(j, z)
Next z
50 Next j
Next k
End Sub
 
Upvote 0
IDCOLORTEMPStartDateEndDateY/N
123ABCgreen1hot01/01/2017Y
123ABC01/01/2017Y
123ABCred2hot01/01/201731/01/2017Y
123ABChot01/01/2017this macro produced the lower table
123ABChot01/01/2017Y
123ABCgreen301/01/201731/01/2017Sub Macro4()
123ABC01/01/2017Y'
123ABChot01/01/2017Y' Macro4 Macro
456DEFgreen4hot08/01/201731/01/2017Y' Macro recorded 12/09/2017 by bob
456DEF08/01/2017Y'
456DEFgreen5hot08/01/201731/01/2017Y
456DEFhot08/01/2017'
456DEFhot08/01/2017Y rrow = 39
456DEFgreen608/01/201731/01/2017 For k = 1 To 2
456DEF08/01/2017Y Match = Cells(k + 32, 1)
456DEFhot08/01/2017Y For j = 2 To 26
456DEFgreen7hot08/01/2017Y If Cells(j, 1) = Match Then GoTo 20 Else GoTo 50
456DEF08/01/2017Y20 If Cells(j, 2) <> "" And Cells(j, 3) <> "" And Cells(j, 4) <> "" Then GoTo 40 Else GoTo 50
123ABCgreen8hot08/01/201731/01/2017Y40 If Cells(j, 5) <> "" And Cells(j, 6) <> "" Then GoTo 45 Else GoTo 50
123ABChot08/01/201745 rrow = rrow + 1
123ABChot08/01/2017Y For z = 1 To 7
123ABCgreen908/01/201731/01/2017 Cells(rrow, z) = Cells(j, z)
123ABC08/01/2017Y Next z
123ABCred1hot08/01/201731/01/2017Y50 Next j
123ABC08/01/2017Yrow 26Next k
End Sub
col F
123ABCrow 33
456DEF
123ABCred2hot01/01/201731/01/2017Y
123ABCgreen8hot08/01/201731/01/2017Y
123ABCred1hot08/01/201731/01/2017Y
456DEFgreen4hot08/01/201731/01/2017Y
456DEFgreen5hot08/01/201731/01/2017Y

<colgroup><col span="3"><col><col><col span="4"><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
ID
COLOR
TEMP
StartDate
EndDate
Y/N
123ABC
green1
hot
01/01/2017
Y
123ABC
01/01/2017
Y
123ABC
red2
hot
01/01/2017
31/01/2017
Y
123ABC
hot
01/01/2017
this macro produced the lower table
123ABC
hot
01/01/2017
Y
123ABC
green3
01/01/2017
31/01/2017
Sub Macro4()
123ABC
01/01/2017
Y
'
123ABC
hot
01/01/2017
Y
' Macro4 Macro
456DEF
green4
hot
08/01/2017
31/01/2017
Y
' Macro recorded 12/09/2017 by bob
456DEF
08/01/2017
Y
'
456DEF
green5
hot
08/01/2017
31/01/2017
Y
456DEF
hot
08/01/2017
'
456DEF
hot
08/01/2017
Y
rrow = 39
456DEF
green6
08/01/2017
31/01/2017
For k = 1 To 2
456DEF
08/01/2017
Y
Match = Cells(k + 32, 1)
456DEF
hot
08/01/2017
Y
For j = 2 To 26
456DEF
green7
hot
08/01/2017
Y
If Cells(j, 1) = Match Then GoTo 20 Else GoTo 50
456DEF
08/01/2017
Y
20 If Cells(j, 2) <> "" And Cells(j, 3) <> "" And Cells(j, 4) <> "" Then GoTo 40 Else GoTo 50
123ABC
green8
hot
08/01/2017
31/01/2017
Y
40 If Cells(j, 5) <> "" And Cells(j, 6) <> "" Then GoTo 45 Else GoTo 50
123ABC
hot
08/01/2017
45 rrow = rrow + 1
123ABC
hot
08/01/2017
Y
For z = 1 To 7
123ABC
green9
08/01/2017
31/01/2017
Cells(rrow, z) = Cells(j, z)
123ABC
08/01/2017
Y
Next z
123ABC
red1
hot
08/01/2017
31/01/2017
Y
50 Next j
123ABC
08/01/2017
Y
row 26
Next k
End Sub
col F
123ABC
row 33
456DEF
123ABC
red2
hot
01/01/2017
31/01/2017
Y
123ABC
green8
hot
08/01/2017
31/01/2017
Y
123ABC
red1
hot
08/01/2017
31/01/2017
Y
456DEF
green4
hot
08/01/2017
31/01/2017
Y
456DEF
green5
hot
08/01/2017
31/01/2017
Y

<tbody>
</tbody>

Thanks oldbrewer for the reply and suggestion. Unfortunately, though, I need a formula to do this rather than a macro/VB.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,580
Members
449,089
Latest member
Motoracer88

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