Removing Complex Duplicates

IML_56

New Member
Joined
Jan 16, 2020
Messages
11
Office Version
  1. 2019
Platform
  1. Windows
Hello all im not sure if this can be done or not, but i have some data with a lot of rows some times there are duplicates. I want to delete a specific value in that duplicate column while retaining the rest of the information. Can this be done in power query?



My example: I want the duplicate row to have the item in boxes removed but keep everything.
ProjectFundingBoxes
AB$1010
AB$10010
CD$205
EF$1520

Result:
ProjectFundingBoxes
AB$1010
AB$100
CD$205
DE$1520


Thanks,
Ian
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I'm not familiar with Power Query but a macro can do what you want. Can there be more than 2 duplicates of any project?
 
Upvote 0
Right click on this field, Replace Values, in Replace With type null then ok but it will replace ALL duplicated values
post more representative example
 
Upvote 0
I'm not familiar with Power Query but a macro can do what you want. Can there be more than 2 duplicates of any project?
There can be more than one duplicate of the same project, and there is multiple projects that have duplicates.
 
Upvote 0
something like this?
ProjectFundingBoxesProjectFundingCustom
AB1010AB1010
AB10010AB100
CD205CD205
EF1520EF1520
xx4530xx4530
xx8930zz89
xx34530vv345
dd543125dd543125
 
Upvote 0
Right click on this field, Replace Values, in Replace With type null then ok but it will replace ALL duplicated values
post more representative example
Not sure if this image helps. I want to go through all the ID in the column and if we thats its a duplicate then go to the units column and delete that duplicate. If i do what you are asking i would delete all duplicates in the units column right?
 

Attachments

  • 2020-07-03_8-22-52.jpg
    2020-07-03_8-22-52.jpg
    149.7 KB · Views: 6
Upvote 0
something like this?
ProjectFundingBoxesProjectFundingCustom
AB1010AB1010
AB10010AB100
CD205CD205
EF1520EF1520
xx4530xx4530
zz8930zz89
vv34530vv345
dd543125dd543125
Yes exactly like that. Is it possible to do that?
 
Upvote 0
Try this macro assuming your data is in columns A, B and C:
VBA Code:
Sub RemoveDups()
    Application.ScreenUpdating = False
    Dim LastRow As Long, RngList As Object, rng As Range, key As Variant, fVisRow As Long
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    Set RngList = CreateObject("Scripting.Dictionary")
    For Each rng In Range("A2:A" & LastRow)
        If Not RngList.Exists(rng.Value) Then
            RngList.Add rng.Value, Nothing
        End If
    Next
    For Each key In RngList
        If WorksheetFunction.CountIf(Range("A:A"), key) > 1 Then
            With ActiveSheet
                .Cells(1, 1).CurrentRegion.AutoFilter 1, key
                fVisRow = .Range("A2:A" & LastRow).SpecialCells(xlCellTypeVisible).Cells(1, 1).Row
                .Range("C" & fVisRow + 1 & ":C" & LastRow).SpecialCells(xlCellTypeVisible).ClearContents
            End With
        End If
    Next key
    Range("A1").AutoFilter
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
Members
449,093
Latest member
Mnur

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