Перейти до основного матеріалу

Як знайти повторювані значення у двох стовпцях у Excel?

Коли ми використовуємо робочий аркуш, іноді нам потрібно порівняти два стовпці і знайти однакові значення. Наприклад, у мене є дві довгі колонки імен студентів, і тепер я хочу порівняти їх і з’ясувати однакові імена. Якщо я порівняю їх клітинку за клітиною, це буде нудно і витратить багато часу. Чи є швидкі способи закінчити це завдання?

Знайдіть повторювані значення у двох стовпцях за допомогою формули

Знайдіть повторювані значення у двох стовпцях із кодом VBA

Швидко знайдіть повторювані значення у двох стовпцях за допомогою Kutools for Excelгарна ідея3

Швидко знайдіть повторювані значення в одному стовпці за допомогою Kutools for Excelгарна ідея3


Знайдіть повторювані значення у двох стовпцях за допомогою формули

Подивіться на наступний знімок екрана, у мене є стовпець A (A2: A15) і стовпець C (C2: C13), які містять кілька повторюваних імен.

doc знайти дублікати 1

За допомогою формули ми можемо порівняти два стовпці та відобразити повторювані значення. Будь ласка, виконайте такі дії:

1. У клітинку B2 введіть цю формулу: = IF (ISERROR (MATCH (A2, A2, $ C $ 13,0: $ C $ 2)), "", AXNUMX).

doc знайти дублікати 2

Примітка: У наведеній вище формулі: A2 - стовпець, який потрібно порівняти. $ 2 $: $ 13 $ - діапазон, з яким потрібно порівняти. Ви можете змінити змінні для того, що ви використовуєте.

2, натисніть Що натомість? Створіть віртуальну версію себе у ключ. Виділіть комірку B2, а потім перетягніть маркер заповнення над комірку B15. І всі повторювані імена будуть відображатися у стовпці B. Дивіться знімок екрана:

doc знайти дублікати 3


Легко поєднуйте стовпці або рядки без втрати даних Excel

з Kutools for Excel's Combine Columns and Rows Утиліта, ви можете швидко об'єднати багато комірок на основі рядка / стовпця, розділених комою або пробілом, або об'єднати діапазон комірок в одну комірку з певним роздільником.
Наприклад, тут я виконую ці операції: (1.) Виберіть Вибрати об'єднати стовпці в розділі Щоб об'єднати вибрані комірки відповідно до наступних параметрів; (2.) Вкажіть роздільник для об’єднаних даних, тут я вибираю пробіл; (3.)) Вкажіть клітинку, куди потрібно розмістити ваш комбінований результат; (4.) Вкажіть, як ви хочете мати справу з об’єднаними клітинками.  Натисніть, щоб отримати повнофункціональну безкоштовну пробну версію 30 дні!
doc поєднують клітинки 1
 
Kutools for Excel: з більш ніж 300 під рукою Excel надбудови, які можна безкоштовно спробувати без обмежень 30 днів.

Знайдіть повторювані значення у двох стовпцях із кодом VBA

Наступний код VBA також може допомогти вам дізнатися повторювані значення між двома стовпцями.

1. Клацання Розробник > Візуальний Бейсік, новий Вікно Microsoft Visual Basic для програм буде відображено, натисніть Insert > Модуліта введіть наступний код в Модуль:

Код VBA: знайти дублікати з двох стовпців

Sub Compare()
Dim Range1 As Range, Range2 As Range, Rng1 As Range, Rng2 As Range, outRng As Range
xTitleId = "KutoolsforExcel"
Set Range1 = Application.Selection
Set Range1 = Application.InputBox("Range1 :", xTitleId, Range1.Address, Type:=8)
Set Range2 = Application.InputBox("Range2:", xTitleId, Type:=8)
Application.ScreenUpdating = False
For Each Rng1 In Range1
    xValue = Rng1.Value
    For Each Rng2 In Range2
        If xValue = Rng2.Value Then
            If outRng Is Nothing Then
                Set outRng = Rng1
            Else
                Set outRng = Application.Union(outRng, Rng1)
            End If
        End If
    Next
Next
outRng.Select
Application.ScreenUpdating = True
End Sub

2. Клацання doc-множення-розрахунок-3 , щоб виконати код, у спливаючому вікні виберіть Діапазон 1, який потрібно порівняти.

doc знайти дублікати 4

3. Клацання OK і продовжуйте вибирати Діапазон 2, з яким Вас будуть порівнювати.

doc знайти дублікати 5

4. Потім натисніть OK, а повторювані значення як у стовпці A, так і в стовпці C були вибрані в стовпці A.

doc знайти дублікати 6

примітки: Якщо ви хочете вибрати дублікати зі стовпця C, вам просто потрібно поміняти місцями два вибрані стовпці.


Швидко знайдіть повторювані значення у двох стовпцях за допомогою Kutools for Excel

За допомогою Kutools for Excel, ви можете швидко і зручно знайти повторювані значення.

Kutools for Excel, з більш ніж 300 зручні функції, полегшує вам роботу. 

після безкоштовна установка Kutools for Excel, будь ласка, виконайте наведені нижче дії:

Натисніть Kutools > Select > Select Same & Different Cells.

doc знайти дублікати 10

1, в Select Same & Different Cells у діалоговому вікні виконайте такі операції:

(1.) Клацніть перший doc-replace-range-names-names-7, щоб вибрати вихідний стовпець для порівняння, а потім натисніть другий doc-replace-range-names-names-7кнопка, щоб вибрати стовпець, з яким вас порівнюють;

(2.) Виберіть Each row під Based on розділ;

(3.) Потім виберіть Ті самі цінності від знайти розділ;

(4.) Нарешті, ви можете вибрати один фон або колір шрифту, щоб виділити ті самі клітинки під Processing of resuts розділ, як вам потрібно.

doc знайти дублікати 8

2 Потім натисніть OK, і однакові значення як у стовпці A, так і в стовпці B були вибрані в стовпці A.

doc знайти дублікати 9

За допомогою цієї утиліти ви також можете знайти різні значення між двома стовпцями.


примітки:

  • My data has headers: Якщо дані, які ви порівнюєте, мають заголовки, ви можете позначити цей параметр, і заголовки не порівнюватимуться.
  • Select entire rows: За допомогою цієї опції будуть вибрані цілі рядки, що містять однакові значення.
  • Case Sensitive: Позначивши цей параметр, ви порівняєте стовпці з урахуванням регістру.
  • Два діапазони порівняння повинні містити однакову кількість стовпців.
  • Якщо ви хочете вибрати дублікати зі стовпця C, вам просто потрібно поміняти місцями два вибрані стовпці.

Демонстрація: швидко знайдіть і виділіть повторювані значення у двох стовпцях

Kutools for Excel: понад 300 функцій, які ви повинні мати Excel, 60-денна безкоштовна пробна версія звідси.

Швидко знайдіть повторювані значення в одному стовпці за допомогою Kutools for Excel

після установки Kutools for Excel, будь ласка, виконайте наведені нижче дії:(Безкоштовне завантаження Kutools for Excel Зараз!)

Іноді вам може знадобитися знайти повторювані значення в стовпці Kutools for Excel також може допомогти вам швидко впоратися з нею.

1. Виберіть стовпець, в якому ви хочете знайти повторювані значення, натисніть Kutools > Select > Select Duplicate & Unique Cells.
doc знайти дублікати 11

2 В Select Duplicate & Unique Cells діалогове вікно, перевірте Duplicates or All duplicates параметр, як вам потрібно, і в той же час, ви можете вирішити виділити дублікати кольором тла або шрифту або не Processing of results .
doc знайти дублікати 12

3. клацання Ok, спливає діалогове вікно, щоб нагадати вам кількість вибраних повторюваних комірок, натисніть OK щоб закрити його, а дублікати відібрано та виділено.
doc знайти дублікати 13


Пов'язані статті:

Як знайти унікальні значення між двома стовпцями в excel?

Найкращі інструменти продуктивності офісу

Підтримує Office/Excel 2007-2021 та 365 | Доступний на 44 мовах | Легко повністю видалити

Популярні функції: Знайти/Виділити/Визначити дублікати   |  Видалити порожні рядки   |  Об’єднайте стовпці або клітинки без втрати даних   |   Раунд без Формули ...
Супер пошук: VLookup за кількома критеріями    Багатозначний VLookup  |   VLookup на кількох аркушах   |   Нечіткий пошук ....
Розширений розкривний список: Швидке створення випадаючого списку   |  Залежний спадний список   |  Виберіть розкривний список, що вибирається ....
Менеджер колонок: Додайте конкретну кількість стовпців     Перемістити стовпці   |   Показати стовпці   |   Порівняти стовпці з Виберіть однакові та різні клітини ...
Особливості: Фокус сітки   |  Перегляд дизайну   |   Велика панель формул    Диспетчер робочих книг і аркушів   |  Бібліотека ресурсів (автотекст)   |  Вибір дати   |  Об’єднайте робочі аркуші   |  Шифрування/розшифрування клітинок    Надсилайте листи за списком   |  Супер фільтр   |   Спеціальний фільтр (фільтр жирний/курсив/закреслений...) ...
Топ-15 наборів інструментів12 текст Tools (додати текст, Видалити символи, ...)   |   50 + Графік типи (діаграма Ганта, ...)   |   40+ Практичний Формули (Розрахуйте вік на основі дня народження, ...)   |   19 вставка Tools (Вставте QR-код, Вставити зображення зі шляху, ...)   |   12 Перетворення Tools (Числа до Words, Валютна конверсія, ...)   |   7 Злиття та розділення Tools (Розширені комбіновані ряди, Розділені клітини, ...)   |   ... і більше

Kutools for Excel Має понад 300 функцій, Переконайтеся, що те, що вам потрібно, знаходиться лише на відстані одного кліка...

Перезарядіть свій Excel Навички: Відчуйте ефективність, як ніколи раніше Kutools for Excel  (Повнофункціональна 30-денна безкоштовна пробна версія)

вкладка kte 201905

60-денна безумовна гарантія повернення грошейДетальніше ... Завантажити безкоштовно... Придбати ... 

Office Tab Надає інтерфейс із вкладками в Office і значно полегшує вашу роботу

  • Увімкнути редагування та читання з вкладками Word, Excel, Штепсельна розетка, Publisher, Access, Visio та Project.
  • Відкривайте та створюйте кілька документів на нових вкладках того самого вікна, а не в нових вікнах.
  • Підвищує вашу продуктивність на 50% і зменшує кількість клацань мишкою щодня! (Повнофункціональна 30-денна безкоштовна пробна версія)
60-денна безумовна гарантія повернення грошейДетальніше ... Завантажити безкоштовно... Придбати ... 
 
Comments (48)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I'm trying to count duplicates from two columns (Column A is the name Column B is the address) how could I do it?
This comment was minimized by the moderator on the site
Hi, Committed, if you want to count total number of duplicates in two columns, firstly, use a formula to count the duplicates in first column:=COUNTIF(A2:A7, A2), A2:A7 is the range of the first column, A2 is the first data except header of the first column. Then use the same formula (change reference) to count the duplicates in second column. Finaly, use SUM function to get the total number of duplicates in two columns.Here is a tutorial which list almost all scenarios about comparing columns, if you are interested in this, you can visit:https://www.extendoffice.com/documents/excel/6392-excel-compare-two-columns.html</div>;
This comment was minimized by the moderator on the site
BUT I WANT DUPLICATE VALUE BEFORE ANY SPACING, IN COLUMN B WE FOUND DUPLICATE VALUES THAT'S GREAT BUT THERE IS SPACE I WANT THOSE VALUES WITHOUT SPACES, HOW CAN I?
This comment was minimized by the moderator on the site
Hi, just remove the spaces by using the Go to special function to find the space cell, then remove them by clicking Delete key after finding the duplicate values.
This comment was minimized by the moderator on the site
Здравствуйте. Макрос приведенный здесь выделяет дубликаты ячеек, но при попытке редактирования какой-либо ячейки выделение снимается сразу со всех дубликатов, как сделать что бы этого не происходило?
This comment was minimized by the moderator on the site
so lovely yeah!
This comment was minimized by the moderator on the site
I LOVE THIS SITE!
This comment was minimized by the moderator on the site
Thank You!
This comment was minimized by the moderator on the site
This shit don't work... just getting

outRng.Select object variable or with block variable not set??
This comment was minimized by the moderator on the site
great demo guys,keep rocking
This comment was minimized by the moderator on the site
Thank You Very Much Guys
This comment was minimized by the moderator on the site
that was really great.
This comment was minimized by the moderator on the site
its good...thnq u ..
This comment was minimized by the moderator on the site
Hi. I have a question ... please help me. We have two sheets. In one of theme, there are names and another one ,address. Some names do not have address. And the addresses and names are irregular. And only with the code We can link theme to each other. I want to do something that names and addresses sort by the code. sorry for my ENGLISH An example of sheets: Sheet 1: name code 2111 David Second sheet: address code st ... 2020 st6 2025 st .. 2111
This comment was minimized by the moderator on the site
Taher... Send me your Email ID. I can help you. What i understand that you have 2 sheets. One has names and some Code for each name and the second one has Addresses and Codes. The Code is the only column which can connect these 2 sheets. And you want all the names and their corresponding addresses to be displayed based on Codes. Please send the same question to my email id . I can send you the script and tell you the steps how it works. Regards Vijay
This comment was minimized by the moderator on the site
When copy =IF(ISERROR(MATCH(A2,$C$2:$C$13,0)),"",A2) make sure take off the full stop at the end or it will not work.
This comment was minimized by the moderator on the site
How to find common value in A1 : S1
This comment was minimized by the moderator on the site
HOW CAN I COMPAIR WHOL TWHO COLUMN TO FIND DUPLICAT VALUE
This comment was minimized by the moderator on the site
I'm trying to compare values on two columns on the same spreadsheet. Where there are duplicates, that is fine. However, where the values differ, I want the contents of one of the columns to be replaced with that of the other column. How do I go about that? Thanks.
This comment was minimized by the moderator on the site
Hi, I need a bit of help. I tried the VBA method and received the following error message: "Compile error. Invalid outside procedure". Any advice would be greatly appreciated, thanks
This comment was minimized by the moderator on the site
THANK YOU VERY MUCH.
This comment was minimized by the moderator on the site
Hello, Is there any way to match & pair duplicates in two separate columns? Example: There are 6 identical search items being searched for and only four identical amounts in the column being searched. The match function finds the 1st duplicate in the column being searched and then returns the ordinal location of that 1st match position for each subsequent duplicate it finds in the search column. Is there any way to identify duplicate matched items & define their distinct ordinal position with the column being searched. This way if there are six duplicate search item amounts and only four duplicates found in the "Search Column" only the four items in the "Search Column" are matched and paired with the items searched. I hope I have explained myself clearly and would like to thank you in advance for any help you may be able to offer on the subject. Kind Regards, RWF
This comment was minimized by the moderator on the site
How to Check Name Two Column with Duplicate?
This comment was minimized by the moderator on the site
Hello! Does not work for Excel 2013! nor using fill down. I used F2 and Enter,
This comment was minimized by the moderator on the site
Thank you very much.
This comment was minimized by the moderator on the site
In your first formula, is there a way to make the names in column C turn red if nothing in Column A matched?
This comment was minimized by the moderator on the site
i want some information regards, Excel Formula A Unique No and B amount c date d date, i want see that whenever i do applying formula pick unique no and calculation should on date C AND d column add value
This comment was minimized by the moderator on the site
Thanks a lot it saved my manual search time !!lot of time!!Copy & paste works but when i enter formula by myself it is not working any clue.
This comment was minimized by the moderator on the site
Hi when you paste it paste it without any format or formula (paste as value)
This comment was minimized by the moderator on the site
greats WORK gUY greats WORK gUY
This comment was minimized by the moderator on the site
Hi, This works only if the values are numeric... But does not if the value is alphabets or alpha numeric - Any other alternatively?
This comment was minimized by the moderator on the site
This article shows how to highlight duplicate values across a number of columns, however it is looking for duplicate values within each column. I was hoping to highlight cells when the value in the 1st cell in column 1, equals the value in the 1st cell in column 2, and the same all the way down. So if A5=B5 I want it to be highlighted, but not highlight if A5=B6, and not highlight if A5=A6. I hope that makes sense. Is there a way to do this?
This comment was minimized by the moderator on the site
I am trying to acknowledge the duplicates within 2 columns. Each column contains about 12000 account #'s and I have to determine which ones are duplicate from the previous year. Any ideas?
This comment was minimized by the moderator on the site
One of the best shortcuts available on the internet to compare two excel columns.
This comment was minimized by the moderator on the site
What is the meaning or purpose of dollar sign ($)in excel?
This comment was minimized by the moderator on the site
Used Formula to find Duplicates in two Columns, worked fine, But now it will not. It acts as if both columns require same format? Didn't before. Please HELP,,,
This comment was minimized by the moderator on the site
I get a bunch of TRUE and FALSE, not the actual Number
This comment was minimized by the moderator on the site
Thaanks a lot..it worked!!! Initially it didn't work for me. I followed Stby 's suggestion and it worked..
This comment was minimized by the moderator on the site
Sadly, this didn't work for me. I have literally copied and pasted the formula, so I don't know why it didn't work. I have experimented with making my data text, numbers, or general. All I get is the formula displayed. The formula actually isn't performing its function.
This comment was minimized by the moderator on the site
You can also use the Match function. Make sure to put your headers so you can also sort after In column A you have 1 list and in column C your 2nd list In B2 use Match(A:A,C:C,0) hit enter.. it won't work if your items aren't matching in what they are, like a number to a number thing Then using your filter function uncheck everything except the N/A in the 2nd column and you will see what isn't in the 1st.. easily knowing what didn't have matches and what did. You can do it both ways so just reverse the C and A in the above formula and see what isn't in A that is in C.. It works great for really long lists, then you don't have to continually scroll for those with and without matches.
This comment was minimized by the moderator on the site
Suggestion to Ian - when copy/pasting from a website to Excel, first copy to Notebook and then to Excel. Sometimes the formatting of the text in the website is what is screwing it up, by sending it through Notebook first you are removing any and all formatting. ~Stby
This comment was minimized by the moderator on the site
I did this, but it still will not work. If I find a duplicate on my own and cut & paste that cell from column c to a. THEN the formula Shows me. ALL cells are Formatted the same. Why is it doing that?
This comment was minimized by the moderator on the site
It works perfect here. You might need to change the , to ; if you havent already done that :)
This comment was minimized by the moderator on the site
[quote]Sadly, this didn't work for me. I have literally copied and pasted the formula, so I don't know why it didn't work. I have experimented with making my data text, numbers, or general. All I get is the formula displayed. The formula actually isn't performing its function.By Ian[/quote] Rename(F2) the cell and press enter again for the formula to register. Note:remove the . at the end of the formula if there is an error
This comment was minimized by the moderator on the site
I had the same problem (only formula displaying) and F2 fixed it. Thanks, this is such a time saving and brilliant solution.
This comment was minimized by the moderator on the site
Saved me a lot of time. Great work. Thanks a lot for your blog post.
This comment was minimized by the moderator on the site
YOU MAGNIFICENT NERD YOU! I've been looking all over and every other tutorial sucks or doesn't understand that this is what people are trying to do. THANK YOU SO MUCH! And Happy Halloween! Keep up the great work!
This comment was minimized by the moderator on the site
Great Work Guys!!! Thanks for the help!!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations