Excel remove duplicates but don t shift cells

In Excel, it will remove all duplicate values and move up when you apply the Remove Duplicates function as screenshot 1 shown. However, in some cases, you may want to remove duplicates but keep the rest of the row values as screenshot 2 shown. Now, in this case, I will introduce some tricks on deleting duplicates but keeping the rest in Excel.

Remove duplicates but keep rest of row values with Filter (3 steps)

Remove duplicates but keep rest of row values with VBA (4 steps)

Remove duplicates but keep rest of row values with Kutools for Excel (2 steps)

Excel remove duplicates but don t shift cells


Remove duplicates but keep rest of row values with Filter

With a formula and the Filter function, you can quickly remove duplicates but keep rest.

1. Select a blank cell next to the data range, D2 for instance, type formula =A3=A2, drag auto fill handle down to the cells you need. See screenshot:

Excel remove duplicates but don t shift cells

2. Select all data range including the formula cell, and click Data > Filter to enable Filter function. See screenshot:

Excel remove duplicates but don t shift cells

3. Click at the Filter icon in Column D (the formula column), and check TURE from the drop down list, see screenshot:

Excel remove duplicates but don t shift cells

4. Click OK, and then all duplicates have been list, and select all of the duplicate values, press Delete key to remove them. See screenshot:

Excel remove duplicates but don t shift cells

5. Click Data > Filter to disable Filter, and remove the formulas as you need. You can see all duplicates have been removed and the rest of values are kept in the row.

Excel remove duplicates but don t shift cells


Remove duplicates but keep rest of row values with VBA

In Excel, there is a VBA code that also can remove duplicates but keep rest of row values.

1. Press Alt + F11 keys to display Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste below code to the Module.

VBA: Remove duplicates but keep rest of row values

Sub RemoveDuplicates()
'UpdatebyExtendoffice20160918

    Dim xRow As Long
    Dim xCol As Long
    Dim xrg As Range
    Dim xl As Long
    On Error Resume Next
    Set xrg = Application.InputBox("Select a range:", "Kutools for Excel", _
                                    ActiveWindow.RangeSelection.AddressLocal, , , , , 8)

    xRow = xrg.Rows.Count + xrg.Row - 1
    xCol = xrg.Column
    'MsgBox xRow & ":" & xCol
    Application.ScreenUpdating = False
    For xl = xRow To 2 Step -1
        If Cells(xl, xCol) = Cells(xl - 1, xCol) Then
            Cells(xl, xCol) = ""
        End If
    Next xl
    Application.ScreenUpdating = True
    
End Sub

Excel remove duplicates but don t shift cells

3. Press F5 key to run the code, a dialog pops out to remind you to select a range to remove duplicate values from. See screenshot:

Excel remove duplicates but don t shift cells

4. Click OK, now the duplicate values have been removed from selection and leave blank cells.

Excel remove duplicates but don t shift cells


Remove duplicates but keep rest of row values with Kutools for Excel

If you have Kutools for Excel – a handy and powerful add in tool installed, you can quickly remove duplicates but keep rest or row values through two wayss.

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

Method 1 Merge Same Cells (2 steps)

1. Select the duplicate values, click Kutools > Merge & Split > Merge Same Cells. See screenshot:

Excel remove duplicates but don t shift cells

2. Then the duplicate values have been merged into one cell. And click Home > Merge & Center > Unmerge Cells to split them. See screenshot:

Excel remove duplicates but don t shift cells

Now the result has been shown as this:

Excel remove duplicates but don t shift cells

Method 2 Select Duplicate & Unique Cells (4 steps)

1. Select the list of data you want to remove duplicates from, and click Kutools > Select > Select Duplicate & Unique Cells. See screenshot:

Excel remove duplicates but don t shift cells

2. In the Select Duplicate & Unique Cells dialog, check Duplicates (Except 1st one) option in the Rule section. See screenshot:

Excel remove duplicates but don t shift cells

3. Click Ok, a dialog pops out to remind you how many duplicates have been selected, click OK to close it. See screenshot:

Excel remove duplicates but don t shift cells

4. Then press Delete key to remove the selected duplicate values.

Excel remove duplicates but don t shift cells

Tip: with Kutools for Excel’s Advanced Combine Rows utility, you can combine the duplicate values and then do some calculations on another column as below screenshot shown. It’s full function without limitation in 30 days,please download and have a free trial now.

Excel remove duplicates but don t shift cells


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.

Excel remove duplicates but don t shift cells


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

Excel remove duplicates but don t shift cells

How do I remove duplicates in Excel without shifting cells?

Click on cell A2 and go to Home > Conditional formatting > New Rule > Use a formula to determine which cells to format..
In the formula bar there, enter this formula. ... .
Click on Format > Fill > Red..
Click on OK/apply..
Copy cell A2, select the range of entries in column A > Right Click > Paste Special > Formats > OK..

How do I remove duplicates without affecting other columns?

Now take the following steps to remove duplicate values:.
Select the range of cells with duplicate values you want to remove..
Next, locate the 'Remove Duplicates' option and select it. Data tab → Data Tools section → Remove Duplicates..
Under Columns, check or uncheck the columns where you want to remove the duplicates..

How do I get rid of duplicates in Excel quickly?

Remove duplicate values.
Select the range of cells that has duplicate values you want to remove. Tip: Remove any outlines or subtotals from your data before trying to remove duplicates..
Click Data > Remove Duplicates, and then Under Columns, check or uncheck the columns where you want to remove the duplicates. ... .
Click OK..

How do you remove duplicates without shifting cells Google Sheets?

Using the UNIQUE Formula.
Open your Google Sheet..
Select a blank cell..
Enter this formula =UNIQUE(A2:D9) indicating the cells you wish to select..
Hit Enter on your keyboard or click away. You will now have a second table with the duplicates removed..