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 extraer valores únicos basados ​​en criterios en Excel?

Supongamos que tiene el siguiente rango de datos en el que desea enumerar solo los nombres únicos de la columna B en función de un criterio específico de la columna A para obtener el resultado que se muestra a continuación. ¿Cómo podría lidiar con esta tarea en Excel rápida y fácilmente?

Extraiga valores únicos según los criterios con la fórmula de matriz

Extrae valores únicos basados ​​en los criterios Kutools para Excel

doc extract uniques con criterio 1



Para resolver este trabajo, puede aplicar una fórmula de matriz compleja, haga lo siguiente:

1. Ingresa esta fórmula: = INDICE ($ B $ 2: $ B $ 17, COINCIDIR (0, IF ($ D $ 2 = $ A $ 2: $ A $ 17, CONTAR CON ($ E $ 1: $ E1, $ B $ 2: $ B $ 17), ""), 0)) en una celda en blanco donde desea enumerar el resultado de la extracción, en este ejemplo, lo pondré en la celda E2, y luego presionaré Shift + Ctrl + Enter para obtener el primer valor único, vea la captura de pantalla:

doc extract uniques con criterio 2

Nota: En la fórmula anterior: B2: B17 es el rango de la columna contiene los valores únicos que desea extraer, A2: A17 es la columna contiene el criterio en el que se basa, D2 indica el criterio sobre el que desea enumerar los valores únicos en función de, y E1 es la celda sobre su fórmula ingresada.

2. A continuación, arrastre el controlador de relleno hacia las celdas para mostrar todos los valores únicos según el criterio específico, vea la captura de pantalla:

doc extract uniques con criterio 3


Si no eres hábil con la fórmula complicada, aquí, voy a hablar de una manera fácil de resolverlo sin ninguna fórmula. Puede filtrar los datos por un criterio específico en primer lugar, y luego aplicar el Seleccionar duplicados y celdas únicas característica de Kutools for Excel para seleccionar los valores únicos y luego pegarlos en otras celdas que necesita.

Kutools for Excel : con más de 300 útiles complementos de Excel, de prueba sin límite en días 60.

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

1. Primero, seleccione el rango de datos que desea usar y haga clic Información > Filtrary haga clic en el botón de flecha junto a la celda en la que desea filtrar los datos según un criterio específico, en el cuadro de lista desplegable, seleccione el criterio que desea filtrar, vea la captura de pantalla:

doc extract uniques con criterio 4

2. Luego haga clic OK, los datos deseados se han filtrado, y seleccione los valores en la columna B de los que desea extraer los nombres únicos, luego haga clic Kutools > Seleccionar > Seleccione celdas duplicadas y exclusivas, mira la captura de pantalla:

doc extract uniques con criterio 5

3. En la Seleccione celdas duplicadas y exclusivas cuadro de diálogo, seleccione Todo único (Incluyendo 1 st duplicados) bajo la Regla sección, ver captura de pantalla:

doc extract uniques con criterio 6

4. Luego haga clic Ok botón, se han seleccionado todos los valores únicos, y luego copie los valores y péguelos en la celda en la que desea que aparezca el resultado, vea la captura de pantalla:

doc extract uniques con criterio 7

Descargue y pruebe de forma gratuita Kutools for Excel Now!


Kutools for Excel: con más de 200 útiles complementos de Excel, de prueba sin límite en días 60. Descargar y prueba gratis ahora!


Kutools for Excel: la mejor herramienta de productividad de Office aumenta su productividad en un 80%

  • 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 y mantener datos; Contenido de celdas divididas; Combinar filas duplicadas y suma / promedio... 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 ...
  • Fórmulas favoritas e insertadas rápidamente, Gamas, cuadros y cuadros; Cifrar celdas con contraseña Crear una lista de correo y enviar correos electrónicos ...
  • 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...
  • Funciona con Office 2007-2019 y 365, y es compatible con todos los idiomas. Es fácil de implementar en su empresa. Funciones completas de prueba gratuita de 60-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.
    Giancarlo · 2 months ago
    Hi! the formula works really well. I would like to add another criterion, i mean, get the unique answers but using two criteria
    • To post as a guest, your comment is unpublished.
      skyyang · 1 months ago
      Hi, Giancarlo,
      to extract unique values based on multiple criteria, any of the below formula can help you: (after pasting the formula, please press Ctrl + Shift + Enter keys together.)
      =IFERROR(INDEX($C$2:$C$11, MATCH(0, COUNTIF(G1:$G$1, $C$2:$C$11)+IF($A$2:$A$11<>$E$2, 1, 0)+IF($B$2:$B$11<>$F$2, 1, 0), 0)), "")
      =INDEX($C$2:$C$11, MATCH(0, IF(($A$2:$A$11=$E$2)*($B$2:$B$11=$F$2), COUNTIF($G$1:$G1, $C$2:$C$11), ""), 0))
      Please try, hope it can help you!
  • To post as a guest, your comment is unpublished.
    Konstantin · 3 months ago
    Is there a way to make this work while ALLOWING for duplicate values? For instance, I want all instances of Lucy to be listed in the results.
    • To post as a guest, your comment is unpublished.
      skyyang · 2 months ago
      Hello, Konstantin,
      To extract all corresponding values including the duplicates based on a specific cell criteria, the following array formula can help you, see screenshot:
      =IF(ISERROR(INDEX($A$1:$B$17,SMALL(IF($A$1:$A$17=$D$2,ROW($A$1:$A$17)),ROW(1:1)),2)),"",
      INDEX($A$1:$B$17,SMALL(IF($A$1:$A$17=$D$2,ROW($A$1:$A$17)),ROW(1:1)),2))

      After inserting the formula, please press Shift + Ctrl + Enter keys together to get the correct result, and then drag the fill handle down to get all values.
      Hope this can help you, thank you!
  • To post as a guest, your comment is unpublished.
    Ed · 11 months ago
    This has worked great for me with a specific lookup value. However, if I wanted to use a wildcard to look up partial values, how would I do that? For example, if I wanted to lookup all the names associated with KT?

    I am using this function to look up cells that contain multiple text. For example if each product also had a sub-product within the same cell but I was only looking for names associated with the sub-product "elf".

    KTE - elf
    KTE- ball
    KTE - piano
    KTO - elf
    KTO- ball
    KTO - piano
  • To post as a guest, your comment is unpublished.
    ewik · 11 months ago
    For me the formula does not work. I press ctrl shift enter and i still get an error N/A. I would like to add that i prpared exaclty the same data as in tutorial. What is the reason it does not work?
  • To post as a guest, your comment is unpublished.
    Joe Jerz · 1 years ago
    How would I get this formula to return each of the duplicates instead of one of each of the names? For instance, in the example above, how would I get the results column (B:B) to return Lucy, Ruby, Anny, Jose, Lucy, Anny, Tom? I'm using this as a budget tool pulling to specific account summaries from a general ledger. However, several of the amounts and transaction descriptions are duplicates in the general ledger. Once the first of the duplicated values is pulled, no more of them get pulled.
    • To post as a guest, your comment is unpublished.
      skyyang · 1 years ago
      Hi, Joe,
      To extract all corresponding values based on a specific cell criteria, the following array formula can help you, see screenshot:
      =IF(ISERROR(INDEX($A$1:$B$17,SMALL(IF($A$1:$A$17=$D$2,ROW($A$1:$A$17)),ROW(1:1)),2)),"",
      INDEX($A$1:$B$17,SMALL(IF($A$1:$A$17=$D$2,ROW($A$1:$A$17)),ROW(1:1)),2))

      After inserting the formula, please press Shift + Ctrl + Enter keys together to get the correct result, and then drag the fill handle down to get all values.
      Hope this can help you, thank you!
      • To post as a guest, your comment is unpublished.
        Joe Jerz · 1 years ago
        Last Question: If I want the results column to return all values not associated with KTE or KTO (so, D:D would be Tom, Nocol, Lily, Angelina, Genna), how would I do that?
      • To post as a guest, your comment is unpublished.
        Joe Jerz · 1 years ago
        Ok, so it works in the master workbook. There is one exception that I haven't been able to determine the cause of: If the array (in my case, the general ledger that I had beginning in row 3) does not begin in Row 1, the returned values are incorrect. What causes this problem, and which term in the formula fixes it? Thanks again for your help with this!
      • To post as a guest, your comment is unpublished.
        Joe Jerz · 1 years ago
        So far so good. I'm able to duplicate the results in the test sheet, make changes to the array, and then correct the formula to account for the changes I've made. I plan to move this into the master sheet today and see how it works. Thanks for the help!
  • To post as a guest, your comment is unpublished.
    Me · 1 years ago
    Thank You!
  • To post as a guest, your comment is unpublished.
    gon · 1 years ago
    I am getting 0 instead of the expected results, the formula is doing great for data in the same sheet, do you have any solution for data in different sheet ?

    this is my formula

    =IFERROR(INDEX('Switching Data'!$B$7:$B$204,MATCH(0,IF($A$2='Switching Data'!$A$7:$A$204,COUNTIF($A$4:A4,'Switching Data'!$B$7:$B$204),""),0)),0)
    • To post as a guest, your comment is unpublished.
      ANIBAL LUCICHE · 2 months ago
      Hello Gon, I hope you are well. I wonder if you can to resolve this issue. I am getting same error when formula come from different sheet. I will appreciate share the solution if you got it.
    • To post as a guest, your comment is unpublished.
      skyyang · 1 years ago
      Hi, Gon,
      After inserting the formula, you should press Ctrl + Shift + Enter keys together, not just Enter key.
      Please try it, thank you!
  • To post as a guest, your comment is unpublished.
    Mujardin · 1 years ago
    If you get the #N/A error, go to your formula and use Control + Shift + Enter instead of Enter.
  • To post as a guest, your comment is unpublished.
    aditya dhavale · 1 years ago
    Hello, I am getting "#N/A" error at "Match function", can you please guide?
  • To post as a guest, your comment is unpublished.
    aditya · 1 years ago
    I am getting #N/A error at Match function with this formula.Can you please help?
  • To post as a guest, your comment is unpublished.
    Sundari · 1 years ago
    actually I want the cell to reflect "YES" if (AL2="AP" and AK2="AD" and Z2>500000)
  • To post as a guest, your comment is unpublished.
    Sundari · 1 years ago
    =IF(AL2="AP","AP",IF(AK2="AD","AD",IF(Z2>500000,"Yes","No"))) I want "all conditions" to be satisfied to say yes...excel reflecting error in this formula..pls advise
  • To post as a guest, your comment is unpublished.
    Michael · 1 years ago
    this was super helpful, but I keep getting doubles of all the names like this:
    Doe, Jane
    Doe, Jane
    Hoover, Tom
    Hoover, Tom

    How can I stop this?
    • To post as a guest, your comment is unpublished.
      aditya dhavale · 1 years ago
      Hello, I am getting "#N/A" error at "Match function", can you please guide?
  • To post as a guest, your comment is unpublished.
    Andre · 1 years ago
    Hi Ryan. Formulas works great, however when dragging down the first value keeps repeating. I have made sure that COUNTIF references the cell ABOVE the cell with the formula, but still repeats the first value when dragging down? (eg. if the array formula is in C2 then COUNTIF points to cell $C$1:$C$1)
    • To post as a guest, your comment is unpublished.
      Camilla · 1 years ago
      Probably doesn`t work cause you´ve locked the cells - Try to replace $C$1:$C$1 with $C$1:$C1
  • To post as a guest, your comment is unpublished.
    Ryan · 2 years ago
    Hi, to stop the first value repeating as you drag down you must COUNTIF the cell ABOVE the cell you're putting the formula in.

    E.g if the formula is going in E2 you must type countif($E$1:$E1...
    • To post as a guest, your comment is unpublished.
      Andre · 1 years ago
      Hi Ryan. Formulas works great, however when dragging down the first value keeps repeating. I have made sure that COUNTIF references the cell ABOVE the cell with the formula, but still repeats the first value when dragging down? (eg. if the array formula is in C2 then COUNTIF points to cell $C$1:$C$1)
  • To post as a guest, your comment is unpublished.
    Amanda · 2 years ago
    When using this formula it keeps repeating the first value, how do you make that stop and provide the list of values that equals the product in D2?
  • To post as a guest, your comment is unpublished.
    Barrett · 2 years ago
    This works really well, but whenever the value that it is putting in is duplicated, it only places the value once. For example, if your list had two Lucy's in it, it only brings one Lucy over to the new table. Is there a way to fix this?
  • To post as a guest, your comment is unpublished.
    Claire · 2 years ago
    Thanks for this I have tried this and seems to be working fine intermittently. The issue that keeps repeating is that sometimes only the first matched value will return and is then duplicated when I am dragging down to return all matched values. How do I prevent this? Any suggestions?
  • To post as a guest, your comment is unpublished.
    JeteMc · 2 years ago
    Thank You, This is great!
  • To post as a guest, your comment is unpublished.
    Aileen · 2 years ago
    Thank you for this tutorial! I'm also trying to modify the formula, like the above commentator, but with an AND condition so it meets another conditional criteria (e.g. for this example, I'd like to see only things above a certain threshold). Can you please advise? Thank you!
    • To post as a guest, your comment is unpublished.
      Konfis · 2 years ago
      Hey,
      One way to do it:
      Replace the if formula with sumproduct((condition1=rng1)+(condition2=rng2))*countif(...

      It worked for me. Good luck! By replacing the + with an * you can make it an OR condition, but take good care of the brackets!
  • To post as a guest, your comment is unpublished.
    Jake · 2 years ago
    Hi, thanks for this tutorial, it works perfectly.

    I'm trying to modify it to work with an OR condition, but it doesn't seem to be working - is this possible?

    e.g. =INDEX($B$2:$B$17, MATCH(0, IF(OR($D$2=$A$2:$A$17,$D$2=$B$2:$B$17), COUNTIF($E$1:$E1, $B$2:$B$17), ""), 0))