Removing duplicate in excel

Find and remove duplicates

Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 Excel 2007 Excel Starter 2010 More…Less

Sometimes duplicate data is useful, sometimes it just makes it harder to understand your data. Use conditional formatting to find and highlight duplicate data. That way you can review the duplicates and decide if you want to remove them.

  1. Select the cells you want to check for duplicates.

    Note: Excel can’t highlight duplicates in the Values area of a PivotTable report.

  2. Click Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.

    Remove Duplicates 1

  3. In the box next to values with, pick the formatting you want to apply to the duplicate values, and then click OK.

    Remove Duplicates 2​​​​​​​

Remove duplicate values

When you use the Remove Duplicates feature, the duplicate data will be permanently deleted. Before you delete the duplicates, it’s a good idea to copy the original data to another worksheet so you don’t accidentally lose any information.

  1. Select the range of cells that has duplicate values you want to remove.

  2. Click Data > Remove Duplicates, and then Under Columns, check or uncheck the columns where you want to remove the duplicates.

    Remove Duplicates 3

    For example, in this worksheet, the January column has price information I want to keep.

    Duplicate values highlighted

    So, I unchecked January in the Remove Duplicates box.

    Remove Duplicates 5

  3. Click OK.

Note: The counts of duplicate and unique values given after removal may include empty cells, spaces, etc. 

Need more help?

Connect with an expert. Learn from live instructors.​​​​​​​

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Skip to content

Как убрать повторяющиеся значения в Excel?

В этом руководстве объясняется, как удалять повторяющиеся значения в Excel. Вы изучите несколько различных методов поиска и удаления дубликатов, избавитесь от дублирующих строк, обнаружите точные повторы и частичные совпадения.

Хотя Microsoft Excel является в первую очередь инструментом для расчетов, его таблицы часто используются в качестве баз данных для отслеживания запасов, составления отчетов о продажах или ведения списков рассылки.

Распространенная проблема, возникающая при увеличении размера базы данных, заключается в том, что в ней появляется много повторов. И даже если ваш огромный файл содержит всего несколько идентичных записей, эти несколько повторов могут вызвать массу проблем. Например, вряд ли порадует отправка нескольких копий одного и того же документа одному человеку или появление одних и тех же данных в отчете несколько раз.

Поэтому, прежде чем использовать базу данных, имеет смысл проверить ее на наличие дублирующих записей, чтобы убедиться, что вы не будете потом тратить время на исправление ошибок.

  • Как вручную удалить повторяющиеся строки
  • Удаление дубликатов в «умной» таблице
  • Убираем повторы, копируя уникальные записи в другое место
  • Формулы для удаления дубликатов
  • Формулы для поиска дубликатов в столбце
  • Удаление дублирующихся строк при помощи формул
  • Универсальный инструмент для поиска и удаления дубликатов в Excel

В нескольких наших недавних статьях мы обсуждали различные способы выявления дубликатов в Excel и выделения неуникальных ячеек или строк (см.ссылки в конце статьи). Однако могут возникнуть ситуации, когда вы захотите в конечном счете устранить дубли в ваших таблицах. И это как раз тема этого руководства.

Удаление повторяющихся строк вручную

Если вы используете последнюю версию Microsoft Excel с 2007 по 2019, у вас есть небольшое преимущество. Эти версии содержат встроенную функцию для поиска и удаления повторяющихся значений.

Этот инструмент позволяет находить и удалять абсолютные совпадения (ячейки или целые строки), а также частично совпадающие записи (имеющие одинаковые значения в столбце или диапазоне). 

Важно! Поскольку инструмент «Удалить дубликаты» навсегда удаляет идентичные записи, рекомендуется создать копию исходных данных, прежде чем удалять что-либо.

Для этого выполните следующие действия.

  1. Для начала выберите диапазон, в котором вы хотите работать. Чтобы выделить всю таблицу, нажмите Ctrl + A,
  2. Указав диапазон, перейдите на вкладку «Данные» >  и нажмите кнопку «Удалить дубликаты» .

  1. Откроется диалоговое окно. Выберите столбцы для проверки на наличие дублей и нажмите кнопку «ОК».
    • Чтобы удалить повторяющиеся строки, которые имеют абсолютно одинаковые данные во всех колонках, оставьте флажки рядом со всеми столбцами, как на скриншоте ниже.
    • Чтобы удалить частичные совпадения на основе одного или нескольких ключевых столбцов, выберите только их. Если в вашей таблице много колонок, самый быстрый способ — нажать кнопку «Снять выделение». А затем отметить те, которые вы хотите проверить.
    • Ежели в вашей таблице нет заголовков, снимите флажок Мои данные в верхнем правом углу диалогового окна, который обычно включается по умолчанию.
  2. Если указать в диалоговом окне все столбцы, строка будет удалена только в том случае, если повторяются значения есть во всех них. Но в некоторых ситуациях не нужно учитывать данные, находящиеся в определенных колонках. Поэтому для них снимите флажки. К примеру, если каждая строчка содержит уникальный идентификационный код, программа никогда не найдет ни одной повторяющейся. Поэтому флажок рядом с колонкой с такими кодами следует снять.

Выполнено! Все повторяющиеся строки в нашем диапазоне удаляются, и отображается сообщение, указывающее, сколько повторяющихся записей было удалено и сколько осталось уникальных.

Важное замечание. Повторяющиеся значения определяются по тому, что отображается в ячейке, а не по тому, что в ней записано на самом деле. Представим, что в A1  и A2 содержится одна и та же дата. Одна из них представлена в формате 15.05.2020, а другая отформатирована в формате 15 май 2020. При поиске повторяющихся значений Excel считает, что это не одно и то же. Аналогично значения, которые отформатированы по-разному, считаются разными, поэтому $1 209,32 — это совсем не одно и то же, что 1209,32.

Поэтому, для того чтобы обеспечить успешный поиск и удаление повторов в таблице или диапазоне данных, рекомендуется применить один формат ко всему столбцу.
Примечание. Функция удаления дублей убирает 2-е и все последующие совпадения, оставляя все уникальные и первые экземпляры идентичных записей. 

Удаление дубликатов в «умной таблице».

Думаю, вы знаете, что, если преобразовать диапазон ячеек в таблицу, в нашем распоряжении появляется множество интересных дополнительных возможностей по работе с этими данными. Именно по этой причине такую таблицу Excel называют «умной».

Выделите нужную нам область, затем на вкладке «Главная» выберите «Форматировать как таблицу». Далее вам будет предложено указать желаемый вариант оформления. Когда закончите, автоматически откроется вкладка «Конструктор».

Выбираем на ленте нужную кнопку, как показано на скриншоте. Затем отмечаем те столбцы, в которых будем искать повторы. Ну а далее произойдет то же самое, что было описано в предыдущем разделе.

Но, в отличие от ранее рассмотренного инструмента удаления, операцию можно отменить, если что-то пошло не так.

Избавьтесь от повторов, скопировав уникальные записи в другое место.

Еще один способ удалить повторы — это выбрать все уникальные записи и скопировать их на другой лист или в другую книгу. Подробные шаги следуют ниже.

  1. Выберите диапазон или всю таблицу, которую вы хотите обработать (1).
  2. Перейдите на вкладку «Данные» (2) и нажмите кнопку «Фильтр — Дополнительно» (3-4).
  3. В диалоговом окне «Расширенный фильтр» (5) выполните следующие действия:
    • Выберите переключатель скопировать в другое место (6).
    • Убедитесь, что в списке диапазонов указан правильный диапазон. Это должен быть диапазон из шага 1.
    • В поле «Поместить результат в…» (7) введите диапазон, в который вы хотите скопировать уникальные записи  (на самом деле достаточно указать его верхнюю левую ячейку).
    • Выберите только уникальные записи (8).
  4. Наконец, нажмите кнопку ОК, и уникальные значения будут скопированы в новое место:

Замечание. Расширенный фильтр позволяет копировать отфильтрованные данные в другое место только на активном листе. Например, выберите место внизу под вашими исходными данными.

Я думаю, вы понимаете, что можно обойтись и без копирования. Просто выберите опцию «Фильтровать список на месте», и дублирующиеся записи будут на время скрыты при помощи фильтра. Они не удаляются, но и мешать вам при этом не будут.

Как убрать дубликаты строк с помощью формул.

Еще один способ удалить неуникальные данные — идентифицировать их с помощью формулы, затем отфильтровать, а затем после этого удалить лишнее.

Преимущество этого подхода заключается в универсальности: он позволяет вам:

  • находить и удалять повторы в одном столбце,
  • находить дубликаты строк на основе значений в нескольких столбиках данных,
  • оставлять первые вхождения повторяющихся записей.

Недостатком является то, что вам нужно будет запомнить несколько формул.

В зависимости от вашей задачи используйте одну из следующих формул для обнаружения повторов. 

Формулы для поиска повторяющихся значений в одном столбце

Добавляем еще одну колонку, в которой запишем формулу.

Повторы наименований товаров, без учета первого вхождения:

=ЕСЛИ(СЧЁТЕСЛИ($B$2:$B2; $B2)>1; «Дубликат»; «»)

Как видите, когда значение встречается впервые (к примеру, в B4), оно рассматривается как вполне обычное. А вот второе его появление (в B7) уже считается повтором.

Отмечаем все повторы вместе с первым появлением:

=ЕСЛИ(СЧЁТЕСЛИ($B$2:$B$17; $B2)>1; «Дубликат»; «Уникальный»)

Где A2 — первая, а A10 — последняя ячейка диапазона, в котором нужно найти совпадения.

Ну а теперь, чтобы убрать ненужное, устанавливаем фильтр и в столбце H и оставляем только «Дубликат». После чего строки, оставшиеся на экране, просто удаляем.

Вот небольшая пошаговая инструкция.

  1. Выберите любую ячейку и примените автоматический фильтр, нажав кнопку «Фильтр» на вкладке «Данные».
  2. Отфильтруйте повторяющиеся строки, щелкнув стрелку в заголовке нужного столбца.
  3. И, наконец, удалите повторы. Для этого выберите отфильтрованные строки, перетаскивая указатель мыши по их номерам, щелкните правой кнопкой мыши и выберите «Удалить строку» в контекстном меню. Причина, по которой вам нужно сделать это вместо простого нажатия кнопки «Удалить» на клавиатуре, заключается в том, что это действие будет удалять целые строки, а не только содержимое ячейки.

Формулы для поиска повторяющихся строк.

В случае, если нам нужно найти и удалить повторяющиеся строки (либо часть их), действуем таким же образом, как для отдельных ячеек. Только формулу немного меняем.

Отмечаем при помощи формулы неуникальные строчки, кроме 1- го вхождения:

=ЕСЛИ(СЧЁТЕСЛИМН($B$2:$B2; $B2;$A$2:A2;$A2;$C$2:C2;$C2)>1; «Дубликат»; «»)

В результате видим 2 повтора.

Теперь самый простой вариант действий – устанавливаем фильтр по столбцу H и слову «Дубликат». После этого просто удаляем сразу все отфильтрованные строки.

Если нам нужно исключить все повторяющиеся строки вместе с их первым появлением:

=ЕСЛИ(СЧЁТЕСЛИМН($B$2:$B$17; $B2;$A$2:$A$17;$A2;$C$2:$C$17;$C2)>1; «Дубликат»; «»)

Далее вновь устанавливаем фильтр и действуем аналогично описанному выше.

Насколько удобен этот  метод – судить вам.

Duplicate Remover — универсальный инструмент для поиска и удаления дубликатов в Excel.

В отличие от встроенной функции Excel для удаления дубликатов, о которой мы рассказывали выше, надстройка Ablebits Duplicate Remover не ограничивается только удалением повторяющихся записей. Подобно швейцарскому ножу, этот многофункциональный инструмент сочетает в себе все основные варианты использования и позволяет определять, выбирать, выделять, удалять, копировать и перемещать уникальные или повторяющиеся значения, с первыми вхождениями или без них, целиком повторяющиеся или частично совпадающие строки в одной таблице или путем сравнения двух таблиц.

Он безупречно работает во всех операционных системах и во всех версиях Microsoft Excel 2019 — 2003.

Как избавиться от дубликатов в Excel в 2 клика мышки.

Предполагая, что в вашем Excel установлен Ultimate Suite, выполните следующие простые шаги, чтобы удалить повторяющиеся строки или ячейки:

  1. Выберите любую ячейку в таблице, c которой вы хотите работать, и нажмите Quick Dedupe на вкладке Ablebits Data.

  1. Откроется диалоговое окно, и все столбцы будут выбраны по умолчанию. Выберите те, которые вам нужны, а также в выпадающем списке в правом нижнем углу укажите желаемое действие.

Поскольку моя цель – просто выделить повторяющиеся данные, я выбрал «Закрасить цветом».

Помимо выделения цветом, вам доступны и другие операции:

  1. Удалить дубликаты
  2. Выбрать дубликаты
  3. Указать их в столбце статуса
  4. Копировать дубликаты на новый лист
  5. Переместить на новый лист
  • Нажимаем кнопку OK и оцениваем получившийся результат:

Как вы можете видеть на скриншоте выше, строки с повторяющимися значениями в первых 3 столбцах были обнаружены (первые вхождения здесь по умолчанию не считаются как дубликаты).

Совет. Если вы хотите определить повторяющиеся строки на основе значений в ключевом столбце, оставьте выбранным только этот столбец (столбцы) и снимите флажки со всех остальных неактуальных столбцов.

И если вы хотите выполнить какое-то другое действие, например, удалить повторяющиеся строки, или скопировать повторяющиеся значения в другое место, выберите соответствующий вариант из раскрывающегося списка.

Больше возможностей для поиска дубликатов при помощи Duplicate Remover.

Если вам нужны дополнительные параметры, такие как удаление повторяющихся строк, включая первые вхождения, или поиск уникальных значений, используйте мастер Duplicate Remover, который предоставляет эти и некоторые другие возможности. Рассмотрим на примере, как найти повторяющиеся значения с первым вхождением или без него.

Удаление дубликатов в Excel — обычная операция. Однако в каждом конкретном случае может быть ряд особенностей. В то время как инструмент Quick Dedupe фокусируется на скорости, Duplicate Remover предлагает ряд дополнительных опций для работы с дубликатами и уникальными значениями.

  1. Выберите любую ячейку в таблице, где вы хотите удалить дубликаты, переключитесь на вкладку Ablebits Data и нажмите кнопку Duplicate Remover.

  1. Вам предложены 4 варианта проверки дубликатов в вашем листе Excel:
    • Дубликаты без первых вхождений повторяющихся записей.
    • Дубликаты с 1-м вхождением.
    • Уникальные записи.
    • Уникальные значения и 1-е повторяющиеся вхождения.
  2. В этом примере выберем второй вариант, т.е. Дубликаты + 1-е вхождения:

  1. Все ваши данные будут автоматически выделены.
  2. Теперь выберите столбцы, в которых вы хотите проверить дубликаты. Как и в предыдущем примере, мы выбираем первые 3 столбца:

  1. Наконец, выберите действие, которое вы хотите выполнить с дубликатами. Как и в случае с инструментом быстрого поиска дубликатов, мастер Duplicate Remover может идентифицировать, выбирать, выделять, удалять, копировать или перемещать повторяющиеся данные.

Чтобы более наглядно увидеть результат, отметим параметр «Закрасить цветом» (Fill with color) и нажимаем Готово.

Мастеру Duplicate Remover требуется совсем немного времени, чтобы проанализировать вашу таблицу и показать результат:

Как видите, результат аналогичен тому, что мы наблюдали выше. Но здесь мы выделили дубликаты, включая и первое появление этих повторяющихся записей. Если вы выберете опцию удаления, то эти 4 записи будут стерты из вашей таблицы.

Надстройка также создает резервную копию рабочего листа, чтобы случайно не потерять нужные данные: вдруг вы хотели оставить первые вхождения данных, но случайно выбрали не тот пункт.

Мы рассмотрели различные способы, которыми вы можете убрать дубликаты из ваших таблиц — при помощи формул и без них. Я надеюсь, что хотя бы одно из решений, упомянутых в этом обзоре, вам подойдет.

Все мощные инструменты очистки дублей, описанные выше, включены в надстройку Ultimate Suite для Excel. Если вы хотите попробовать их, я рекомендую вам загрузить полнофункциональную пробную версию и сообщить нам свой отзыв в комментариях.

Что ж, как вы только что видели, есть несколько способов найти повторяющиеся значения в Excel и затем удалить их. И каждый из них имеет свои сильные стороны и ограничения. 

Еще на эту же тему:

Duplicate values in your data can be a big problem! It can lead to substantial errors and over estimate your results.

But finding and removing them from your data is actually quite easy in Excel.

In this tutorial, we are going to look at 7 different methods to locate and remove duplicate values from your data.

Video Tutorial

What Is A Duplicate Value?

Duplicate values happen when the same value or set of values appear in your data.

For a given set of data you can define duplicates in many different ways.

In the above example, there is a simple set of data with 3 columns for the Make, Model and Year for a list of cars.

  1. The first image highlights all the duplicates based only on the Make of the car.
  2. The second image highlights all the duplicates based on the Make and Model of the car. This results in one less duplicate.
  3. The second image highlights all the duplicates based on all columns in the table. This results in even less values being considered duplicates.

The results from duplicates based on a single column vs the entire table can be very different. You should always be aware which version you want and what Excel is doing.

Find And Remove Duplicate Values With The Remove Duplicates Command

Removing duplicate values in data is a very common task. It’s so common, there’s a dedicated command to do it in the ribbon.

Select a cell inside the data which you want to remove duplicates from and go to the Data tab and click on the Remove Duplicates command.

Excel will then select the entire set of data and open up the Remove Duplicates window.

  1. You then need to tell Excel if the data contains column headers in the first row. If this is checked, then the first row of data will be excluded when finding and removing duplicate values.
  2. You can then select which columns to use to determine duplicates. There are also handy Select All and Unselect All buttons above you can use if you’ve got a long list of columns in your data.

When you press OK, Excel will then remove all the duplicate values it finds and give you a summary count of how many values were removed and how many values remain.

This command will alter your data so it’s best to perform the command on a copy of your data to retain the original data intact.

Find And Remove Duplicate Values With Advanced Filters

There is also another way to get rid of any duplicate values in your data from the ribbon. This is possible from the advanced filters.

Select a cell inside the data and go to the Data tab and click on the Advanced filter command.

This will open up the Advanced Filter window.

  1. You can choose to either to Filter the list in place or Copy to another location. Filtering the list in place will hide rows containing any duplicates while copying to another location will create a copy of the data.
  2. Excel will guess the range of data, but you can adjust it in the List range. The Criteria range can be left blank and the Copy to field will need to be filled if the Copy to another location option was chosen.
  3. Check the box for Unique records only.

Press OK and you will eliminate the duplicate values.

Advanced filters can be a handy option for getting rid of your duplicate values and creating a copy of your data at the same time. But advanced filters will only be able to perform this on the entire table.

Find And Remove Duplicate Values With A Pivot Table

Pivot tables are just for analyzing your data, right?

You can actually use them to remove duplicate data as well!

You won’t actually be removing duplicate values from your data with this method, you will be using a pivot table to display only the unique values from the data set.

First, create a pivot table based on your data. Select a cell inside your data or the entire range of data ➜ go to the Insert tab ➜ select PivotTable ➜ press OK in the Create PivotTable dialog box.

With the new blank pivot table add all fields into the Rows area of the pivot table.

You will then need to change the layout of the resulting pivot table so it’s in a tabular format. With the pivot table selected, go to the Design tab and select Report Layout. There are two options you will need to change here.

  1. Select the Show in Tabular Form option.
  2. Select the Repeat All Item Labels option.

You will also need to remove any subtotals from the pivot table. Go to the Design tab ➜ select Subtotals ➜ select Do Not Show Subtotals.

You now have a pivot table that mimics a tabular set of data!

Pivot tables only list unique values for items in the Rows area, so this pivot table will automatically remove any duplicates in your data.

Find And Remove Duplicate Values With Power Query

Power Query is all about data transformation, so you can be sure it has the ability to find and remove duplicate values.

Select the table of values which you want to remove duplicates from ➜ go to the Data tab ➜ choose a From Table/Range query.

Remove Duplicates Based On One Or More Columns

With Power Query, you can remove duplicates based on one or more columns in the table.

You need to select which columns to remove duplicates based on. You can hold Ctrl to select multiple columns.

Right click on the selected column heading and choose Remove Duplicates from the menu.

You can also access this command from the Home tab ➜ Remove RowsRemove Duplicates.

= Table.Distinct(#"Previous Step", {"Make", "Model"})

If you look at the formula that’s created, it is using the Table.Distinct function with the second parameter referencing which columns to use.

Remove Duplicates Based On The Entire Table

To remove duplicates based on the entire table, you could select all the columns in the table then remove duplicates. But there is a faster method that doesn’t require selecting all the columns.

There is a button in the top left corner of the data preview with a selection of commands that can be applied to the entire table.

Click on the table button in the top left corner ➜ then choose Remove Duplicates.

= Table.Distinct(#"Previous Step")

If you look at the formula that’s created, it uses the same Table.Distinct function with no second parameter. Without the second parameter, the function will act on the whole table.

Keep Duplicates Based On A Single Column Or On The Entire Table

In Power Query, there are also commands for keeping duplicates for selected columns or for the entire table.

Follow the same steps as removing duplicates, but use the Keep RowsKeep Duplicates command instead. This will show you all the data that has a duplicate value.

Find And Remove Duplicate Values Using A Formula

You can use a formula to help you find duplicate values in your data.

First you will need to add a helper column that combines the data from any columns which you want to base your duplicate definition on.

= [@Make] & [@Model] & [@Year]

The above formula will concatenate all three columns into a single column. It uses the ampersand operator to join each column.

= TEXTJOIN("", FALSE , CarList[@[Make]:[Year]])

If you have a long list of columns to combine, you can use the above formula instead. This way you can simply reference all the columns as a single range.

You will then need to add another column to count the duplicate values. This will be used later to filter out rows of data that appear more than once.

= COUNTIFS($E$3:E3, E3)

Copy the above formula down the column and it will count the number of times the current value appears in the list of values above.

If the count is 1 then it’s the first time the value is appearing in the data and you will keep this in your set of unique values. If the count is 2 or more then the value has already appeared in the data and it is a duplicate value which can be removed.

Add filters to your data list.

  • Go to the Data tab and select the Filter command.
  • Use the keyboard shortcut Ctrl + Shift + L.

Now you can filter on the Count column. Filtering on 1 will produce all the unique values and remove any duplicates.

You can then select the visible cells from the resulting filter to copy and paste elsewhere. Use the keyboard shortcut Alt + ; to select only the visible cells.

Find And Remove Duplicate Values With Conditional Formatting

With conditional formatting, there’s a way to highlight duplicate values in your data.

Just like the formula method, you need to add a helper column that combines the data from columns. The conditional formatting doesn’t work with data across rows, so you’ll need this combined column if you want to detect duplicates based on more than one column.

Then you need to select the column of combined data.

To create the conditional formatting, go to the Home tab ➜ select Conditional FormattingHighlight Cells RulesDuplicate Values.

This will open up the conditional formatting Duplicate Values window.

  1. You can select to either highlight Duplicate or Unique values.
  2. You can also choose from a selection of predefined cell formats to highlight the values or create your own custom format.

Warning: The previous methods to find and remove duplicates considers the first occurrence of a value as a duplicate and will leave it intact. However, this method will highlight the first occurrence and will not make any distinction.

With the values highlighted, you can now filter on either the duplicate or unique values with the filter by color option. Make sure to add filters to your data. Go to the Data tab and select the Filter command or use the keyboard shortcut Ctrl + Shift + L.

  1. Click on the filter toggle.
  2. Select Filter by Color in the menu.
  3. Filter on the color used in the conditional formatting to select duplicate values or filter on No Fill to select unique values.

You can then select just the visible cells with the keyboard shortcut Alt + ;.

Find And Remove Duplicate Values Using VBA

There is a built in command in VBA for removing duplicates within list objects.

Sub RemoveDuplicates() Dim DuplicateValues As Range Set DuplicateValues = ActiveSheet.ListObjects("CarList").Range DuplicateValues.RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlYes End Sub

The above procedure will remove duplicates from an Excel table named CarList.

Columns:=Array(1, 2, 3)

The above part of the procedure will set which columns to base duplicate detection on. In this case it will be on the entire table since all three columns are listed.

Header:=xlYes

The above part of the procedure tells Excel the first row in our list contains column headings.

You will want to create a copy of your data before running this VBA code, as it can’t be undone after the code runs.

Conclusions

Duplicate values in your data can be a big obstacle to a clean data set.

Thankfully, there are many options in Excel to easily remove those pesky duplicate values.

So, what’s your go to method to remove duplicates?

About the Author

John MacDougall

John is a Microsoft MVP and qualified actuary with over 15 years of experience. He has worked in a variety of industries, including insurance, ad tech, and most recently Power Platform consulting. He is a keen problem solver and has a passion for using technology to make businesses more efficient.

This example teaches you how to remove duplicates in Excel.

1. Click any single cell inside the data set.

2. On the Data tab, in the Data Tools group, click Remove Duplicates.

Click Remove Duplicates

The following dialog box appears.

3. Leave all check boxes checked and click OK.

Remove Duplicates Dialog Box

Result. Excel removes all identical rows (blue) except for the first identical row found (yellow).

Remove Duplicates Example Remove Duplicates Result

To remove rows with the same values in certain columns, execute the following steps.

4. For example, remove rows with the same Last Name and Country.

5. Check Last Name and Country and click OK.

Select Columns

Result. Excel removes all rows with the same Last Name and Country (blue) except for the first instances found (yellow).

Remove Duplicates Example Remove Duplicates Result

Let’s take a look at one more cool Excel feature that removes duplicates. You can use the Advanced Filter to extract unique rows (or unique values in a column).

6. On the Data tab, in the Sort & Filter group, click Advanced.

Click Advanced

The Advanced Filter dialog box appears.

7. Click Copy to another location.

8. Click in the List range box and select the range A1:A17 (see images below).

9. Click in the Copy to box and select cell F1 (see images below).

10. Check Unique records only.

Unique Records Only

11. Click OK.

Result. Excel removes all duplicate last names and sends the result to column F.

Unique Values

Note: at step 8, instead of selecting the range A1:A17, select the range A1:D17 to extract unique rows.

12. Finally, you can use conditional formatting in Excel to highlight duplicate values.

Duplicate Values

13. Or use conditional formatting in Excel to highlight duplicate rows.

Duplicate Rows

Tip: visit our page about finding duplicates to learn more about these tricks.

This wikiHow teaches you how to remove duplicate entries from a Microsoft Excel spreadsheet.

  1. Image titled Remove Duplicates in Excel Step 1

    1

    Double-click your Excel document. This will open the spreadsheet in Excel.

    • You can also open an existing document from the «Recent» section of the Open tab.
  2. Image titled Remove Duplicates in Excel Step 2

    2

    Select your data group. To do so, click the top entry, hold down Shift, and click the bottom entry.

    • If you’re selecting multiple columns, click the top-left entry, then click the bottom-right entry while holding down Shift.
  3. Image titled Remove Duplicates in Excel Step 3

    3

    Click the Data tab. It’s a tab on the left side of the green ribbon at the top of the Excel window.

  4. Image titled Remove Duplicates in Excel Step 4

    4

    Click Remove Duplicates. This option is the «Data Tools» section of the Data toolbar near the top of the Excel window. A pop-up window will appear with the option of selecting or de-selecting columns.

  5. Image titled Remove Duplicates in Excel Step 5

    5

    Make sure each column you wish to edit is selected. You’ll see several column names (e.g., «Column A», «Column B») next to checkboxes; clicking a checkbox will de-select the column in question.

    • By default, all columns next to the one you select will be listed and checked here.
    • You can click Select All to select all of the columns listed.
  6. Image titled Remove Duplicates in Excel Step 6

    6

    Click OK. Doing so will remove any duplicates from your Excel spreadsheet selection.

    • If no duplicates are reported when you know there are duplicates, try selecting one column at a time.
  1. Image titled Remove Duplicates in Excel Step 7

    1

    Double-click your Excel document. This will open the spreadsheet in Excel, allowing you to check it for cells containing duplicate values by using the Conditional Formatting feature. If you want to look for duplicates but don’t want to delete them by default, this is a good way of doing so.

    • You can also open an existing document from the «Recent» section of the Open tab.
  2. Image titled Remove Duplicates in Excel Step 8

    2

    Click the top-left cell in your data group. Doing so will select it.

    • Exclude headers (e.g., «Date», «Time», etc.) from your selection.
    • If you’re just selecting one row, click the left-most entry.
    • If you’re just selecting one column, click the top-most entry.
  3. Image titled Remove Duplicates in Excel Step 9

    3

    Hold down Shift and click the bottom-right cell. This will select any data between the top-left corner and the bottom-right corner of the data group.

    • If you’re selecting one row, just click the right-most cell with data in it.
    • If you’re selecting one column, just click the bottom-most entry with data in it.
  4. Image titled Remove Duplicates in Excel Step 10

    4

    Click Conditional Formatting. It’s in the «Styles» section of the Home tab. Doing so will prompt a drop-down menu.

    • You may first need to click Home near the top of the Excel window to view this option.
  5. Image titled Remove Duplicates in Excel Step 11

    5

    Select Highlight Cells Rules. You’ll see a window pop out from here.

  6. Image titled Remove Duplicates in Excel Step 12

    6

    Click Duplicate Values. It’s at the bottom of the pop-out menu. Clicking this option will select all duplicate values in your selected range.

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

About this article

Article SummaryX

1. Open the Excel document.
2. Select your data group.
3. Click Data.
4. Click Remove Duplicates.
5. Click OK.

Did this summary help you?

Thanks to all authors for creating a page that has been read 420,580 times.

Reader Success Stories

  • Anonymous

    «Simple click that save me tons of time sorting and filtering.»

Is this article up to date?

Понравилась статья? Поделить с друзьями:
  • Removing a page from word
  • Remover для microsoft excel
  • Regular expressions word boundary
  • Regular expressions one word
  • Regular expressions not word