Consejo: Otros idiomas son traducidos por Google. Puedes visitar el English versión de este enlace.
Iniciar sesión
x
or
x
x
Suscríbete
x

or

¿Cómo encontrar valores duplicados en dos columnas en Excel?

Cuando usamos una hoja de trabajo, a veces necesitamos comparar dos columnas y encontrar los mismos valores. Por ejemplo, tengo dos largas columnas de nombres de estudiantes, y ahora, quiero compararlos y descubrir los mismos nombres. Si los comparo celda por celda, será tedioso y perderá mucho tiempo. ¿Hay alguna forma rápida de terminar esta tarea?

Encuentra valores duplicados en dos columnas con fórmula

Encuentra valores duplicados en dos columnas con código VBA

Encuentre rápidamente valores duplicados en dos columnas con Kutools para Excelbuena idea3

Encuentre rápidamente valores duplicados en una columna con Kutools para Excelbuena idea3


Combina columnas o filas fácilmente sin perder datos en Excel

Con Kutools for Excel's Combine Columns and Rows utilidad, puede combinar rápidamente las celdas de varios niveles según la fila / columna y separarlas por comas o espacio, o combinar un rango de celdas en una sola celda con un separador específico.
Por ejemplo, aquí realizo estas operaciones: (1.) Seleccione Seleccionar Combine columnas bajo Para combinar celdas seleccionadas de acuerdo a las siguientes opciones; (2.) Especifique un separador para los datos combinados, aquí selecciono Espacio; (3.)) Especifique la celda donde desea colocar su resultado combinado; (4.) Especifique cómo desea tratar las celdas combinadas. ¡Haga clic para obtener una prueba gratuita con todas las funciones en 30 días!
doc combine células 1
Kutools para Excel: con más de 300 prácticos complementos de Excel, prueba gratuita sin limitación en los días de 30.

Encuentra valores duplicados en dos columnas con fórmula


Mira la siguiente captura de pantalla, tengo la columna A (A2: A15) y la columna C (C2: C13) que contienen algunos nombres duplicados.

doc encontrar duplicados 1

Al usar una fórmula, podemos comparar dos columnas y mostrar los valores duplicados. Por favor haz los siguientes pasos:

1. En la celda B2, ingrese esta fórmula: = IF (ISERROR (MATCH (A2, $ C $ 2: $ C $ 13,0)), "", A2.

doc encontrar duplicados 2

Nota: En la fórmula anterior: A2 es la columna que quieres que se compare. $ C $ 2: $ C $ 13 es el rango con el que quieres que se compare. Puede cambiar las variables para lo que está usando.

2. presione el entrar llave. Seleccione la celda B2, y luego arrastre el controlador de relleno sobre la celda B15. Y todos los nombres duplicados se mostrarán en la columna B. Ver captura de pantalla:

doc encontrar duplicados 3


Encuentra valores duplicados en dos columnas con código VBA

El siguiente código de VBA también puede ayudarlo a encontrar los valores duplicados entre dos columnas.

1. Hacer clic Desarrollador > Visual Basic, Un nuevo Microsoft Visual Basic para ventana de aplicaciones se mostrará, haga clic en recuadro > Móduloe ingrese el siguiente código en el Módulo:

Código de VBA: encuentre duplicados de dos columnas

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. Hacer clic doc-multiply-calculation-3 para ejecutar el código, en el recuadro emergente, seleccione Rango 1 que desea comparar.

doc encontrar duplicados 4

3. Hacer clic OK y continúe seleccionando Range 2 con el que será comparado.

doc encontrar duplicados 5

4. Luego haga clic OK, y los valores duplicados tanto en la columna A como en la columna C se han seleccionado en la columna A.

doc encontrar duplicados 6

Nota: Si desea seleccionar los duplicados de la columna C, solo necesita intercambiar las dos columnas seleccionadas.


Encuentre rápidamente valores duplicados en dos columnas con Kutools para Excel

Con la ayuda de los Kutools for Excel, puede encontrar los valores duplicados de forma rápida y cómoda.

Kutools for Excel, con más de 300 Funciones prácticas, hace que sus trabajos sean más fáciles.

Después de instalar Kutools para Excel, haz lo siguiente:(Descarga gratuita Kutools for Excel ahora!)

Haz click Kutools > Select > Select Same & Different Cells.

doc encontrar duplicados 10

1. En la Select Same & Different Cells cuadro de diálogo, realice las siguientes operaciones:

(1.) Haga clic en el primer doc-replace-range-names-7para seleccionar la columna fuente que se va a comparar, luego haga clic en el segundo doc-replace-range-names-7para seleccionar la columna con la que se compara;

(2.) Elija Each row bajo la Based on sección;

(3.) Luego seleccione Mismos valores desde el Buscar sección;

(4.) Por fin, puede elegir un fondo o color de fuente para resaltar las mismas celdas debajo del Processing of resuts sección según sea necesario

doc encontrar duplicados 8

2. Luego haga clic OK, y los mismos valores tanto en la columna A como en la columna B han sido seleccionados en la columna A.

doc encontrar duplicados 9

Con esta utilidad, también puede encontrar los diferentes valores entre dos columnas.


Notas:

  • My data has headers: Si los datos que se comparan tienen encabezados, puede marcar esta opción y los encabezados no se compararán.
  • Select entire rows: Con esta opción, se seleccionarán las filas completas que contienen los mismos valores.
  • Case Sensitive: Al marcar esta opción, comparará las columnas con mayúsculas y minúsculas.
  • Los dos rangos de comparación deben contener el mismo número de columnas.
  • Si desea seleccionar los duplicados de la columna C, solo necesita intercambiar las dos columnas seleccionadas.

Demostración: encuentre y resalte rápidamente los valores duplicados en dos columnas

Kutools para Excel: funciones 300 + que debe tener en Excel, Prueba gratuita 60-day desde aquí.

Encuentre rápidamente valores duplicados en una columna con Kutools para Excel

Después de instalar Kutools para Excel, haz lo siguiente:(Descarga gratuita Kutools for Excel ahora!)

A veces, es posible que desee encontrar los valores duplicados en una columna, Kutools for Excel también puede ayudarlo a manejarlo rápidamente.

1. Seleccione la columna en la que desea encontrar los valores duplicados, haga clic en Kutools > Select > Select Duplicate & Unique Cells.
doc encontrar duplicados 11

2. En el Select Duplicate & Unique Cells diálogo, verificar Duplicates or All duplicates opción que necesita, y al mismo tiempo, puede decidir resaltar los duplicados con el fondo o el color de la fuente o no en Processing of results .
doc encontrar duplicados 12

3. Hacer clic Ok, aparece un cuadro de diálogo para recordarle la cantidad de celdas duplicadas seleccionadas, haga clic en OK para cerrarlo, y los duplicados son seleccionados y resaltados.
doc encontrar duplicados 13


Artículo relacionado:

¿Cómo encontrar valores únicos entre dos columnas en Excel?


Kutools for Excel resuelve la mayoría de sus problemas y aumenta su productividad en un 80%

  • Reutilizar: Insertar rápidamente fórmulas complejas, gráficos y cualquier cosa que hayas usado antes; Cifrar celdas con contraseña Crear una lista de correo y enviar correos electrónicos ...
  • Super Formula Bar (edite fácilmente varias líneas de texto y fórmula); Diseño de lectura (lee y edita fácilmente un gran número de celdas); Pegar en rango filtrado...
  • Combinar celdas / filas / columnas sin perder datos; Contenido de celdas divididas; Combinar filas / columnas duplicadas... Prevenir células duplicadas; Comparar rangos...
  • Seleccione Duplicado o Único Filas; Seleccionar filas en blanco (todas las celdas están vacías); Super Find y Fuzzy Find en muchos libros de trabajo; Selección aleatoria ...
  • Copia exacta Celdas múltiples sin cambiar la referencia de fórmula; Crear referencias automáticamente a múltiples hojas; Insertar viñetas, Casillas de verificación y más ...
  • Extracto del texto, Agregar texto, Eliminar por posición, Eliminar espacio; Crear e imprimir subtotales de paginación; Convertir entre contenido de celdas y comentarios...
  • Súper filtro (guardar y aplicar esquemas de filtro a otras hojas); Clasificación avanzada por mes / semana / día, frecuencia y más; Filtro especial por negrita, cursiva ...
  • Combinar libros de trabajo y hojas de trabajo; Combinar tablas basadas en columnas clave; Dividir datos en varias hojas; Conversión por lotes xls, xlsx y PDF...
  • Más de potentes funciones de 300. Admite Office / Excel 2007-2019 y 365. Soporta todos los idiomas. Fácil implementación en su empresa u organización. Funciones completas de prueba gratuita de 30-day.
pestaña kte 201905

Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilitar la edición y lectura con pestañas en Word, Excel, PowerPoint, Editor, Acceso, Visio y Proyecto.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta tu productividad en un 50% y reduce cientos de clics de ratón por ti todos los días!
fondo officetab
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Дмитрий · 2 months ago
    Здравствуйте. Макрос приведенный здесь выделяет дубликаты ячеек, но при попытке редактирования какой-либо ячейки выделение снимается сразу со всех дубликатов, как сделать что бы этого не происходило?
  • To post as a guest, your comment is unpublished.
    Luis · 1 years ago
    so lovely yeah!
  • To post as a guest, your comment is unpublished.
    Conrad Blume · 1 years ago
    I LOVE THIS SITE!
  • To post as a guest, your comment is unpublished.
    JeteMc · 2 years ago
    Thank You!
  • To post as a guest, your comment is unpublished.
    :( · 2 years ago
    This shit don't work... just getting

    outRng.Select object variable or with block variable not set??
  • To post as a guest, your comment is unpublished.
    vishnu · 2 years ago
    great demo guys,keep rocking
  • To post as a guest, your comment is unpublished.
    Shameer · 2 years ago
    Thank You Very Much Guys
  • To post as a guest, your comment is unpublished.
    Sobuj Prantor · 2 years ago
    that was really great.
  • To post as a guest, your comment is unpublished.
    RITESH · 2 years ago
    its good...thnq u




    ..
  • To post as a guest, your comment is unpublished.
    Taher · 2 years ago
    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
    • To post as a guest, your comment is unpublished.
      Vijay · 2 years ago
      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 vijkid143@gmail.com. I can send you the script and tell you the steps how it works.

      Regards
      Vijay
  • To post as a guest, your comment is unpublished.
    Matt · 3 years ago
    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.
  • To post as a guest, your comment is unpublished.
    Bhaskar · 3 years ago
    How to find common value in A1 : S1
  • To post as a guest, your comment is unpublished.
    NISHIT · 3 years ago
    HOW CAN I COMPAIR WHOL TWHO COLUMN TO FIND DUPLICAT VALUE
  • To post as a guest, your comment is unpublished.
    Nike · 3 years ago
    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.
  • To post as a guest, your comment is unpublished.
    Summer · 3 years ago
    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
  • To post as a guest, your comment is unpublished.
    Carlos Ferreira · 3 years ago
    THANK YOU VERY MUCH.
  • To post as a guest, your comment is unpublished.
    Rick · 3 years ago
    Hello,
    Is there any way to [u]match & pair [/u]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
  • To post as a guest, your comment is unpublished.
    Vikas · 4 years ago
    How to Check Name Two Column with Duplicate?
  • To post as a guest, your comment is unpublished.
    JOP · 4 years ago
    Hello!
    Does not work for Excel 2013! nor using fill down.
    I used F2 and Enter,
  • To post as a guest, your comment is unpublished.
    Gopi · 4 years ago
    Thank you very much.
  • To post as a guest, your comment is unpublished.
    Keith · 4 years ago
    In your first formula, is there a way to make the names in column C turn red if nothing in Column A matched?
  • To post as a guest, your comment is unpublished.
    Sanjay Kumar · 4 years ago
    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
  • To post as a guest, your comment is unpublished.
    Tan · 4 years ago
    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.
  • To post as a guest, your comment is unpublished.
    AMS · 4 years ago
    Hi
    when you paste it paste it without any format or formula (paste as value)
  • To post as a guest, your comment is unpublished.
    xprexweb · 4 years ago
    greats WORK gUY greats WORK gUY
  • To post as a guest, your comment is unpublished.
    Dominic · 4 years ago
    Hi,
    This works only if the values are numeric... But does not if the value is alphabets or alpha numeric - Any other alternatively?
  • To post as a guest, your comment is unpublished.
    CC · 4 years ago
    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?
  • To post as a guest, your comment is unpublished.
    JP · 5 years ago
    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?
  • To post as a guest, your comment is unpublished.
    Ankit · 5 years ago
    One of the best shortcuts available on the internet to compare two excel columns.
  • To post as a guest, your comment is unpublished.
    Umar · 5 years ago
    What is the meaning or purpose of dollar sign ($)in excel?
  • To post as a guest, your comment is unpublished.
    JOEL · 5 years ago
    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,,,
  • To post as a guest, your comment is unpublished.
    Martin · 5 years ago
    I get a bunch of TRUE and FALSE, not the actual Number
  • To post as a guest, your comment is unpublished.
    SUDHEEP · 5 years ago
    Thaanks a lot..it worked!!!
    Initially it didn't work for me. I followed Stby 's suggestion and it worked..
  • To post as a guest, your comment is unpublished.
    Ian · 5 years ago
    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.
    • To post as a guest, your comment is unpublished.
      There is another way · 3 years ago
      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.
    • To post as a guest, your comment is unpublished.
      Stby · 5 years ago
      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
      • To post as a guest, your comment is unpublished.
        JOEL · 5 years ago
        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?
    • To post as a guest, your comment is unpublished.
      Simen H · 5 years ago
      It works perfect here. You might need to change the , to ; if you havent already done that :)
    • To post as a guest, your comment is unpublished.
      Wilson · 5 years ago
      [quote name="Ian"]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.[/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
      • To post as a guest, your comment is unpublished.
        Alex789 · 4 years ago
        I had the same problem (only formula displaying) and F2 fixed it. Thanks, this is such a time saving and brilliant solution.
  • To post as a guest, your comment is unpublished.
    Praveen · 5 years ago
    Saved me a lot of time. Great work.

    Thanks a lot for your blog post.
  • To post as a guest, your comment is unpublished.
    Bob Dole · 6 years ago
    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!
  • To post as a guest, your comment is unpublished.
    Dorai Kannah · 6 years ago
    Great Work Guys!!!
    Thanks for the help!!