Vai al contenuto principale

Come estrarre valori univoci in base a criteri in Excel?

Supponiamo che tu abbia l'intervallo di dati sinistro che desideri elencare solo i nomi univoci della colonna B in base a un criterio specifico della colonna A per ottenere il risultato come mostrato nell'immagine sottostante. Come potresti gestire questa attività in Excel in modo rapido e semplice?

Estrai valori univoci in base a criteri con formula di matrice

Estrai valori univoci in base a più criteri con la formula di matrice

Estrai valori univoci da un elenco di celle con una funzione utile

 

Estrai valori univoci in base a criteri con formula di matrice

Per risolvere questo lavoro, puoi applicare una formula di matrice complessa, per favore fai come segue:

1. Immettere la formula seguente in una cella vuota in cui si desidera elencare il risultato dell'estrazione, in questo esempio, lo inserirò nella cella E2, quindi premere Maiusc + Ctrl + Invio chiavi per ottenere il primo valore univoco.

=IFERROR(INDEX($B$2:$B$15, MATCH(0, IF($D$2=$A$2:$A$15, COUNTIF($E$1:$E1, $B$2:$B$15), ""), 0)),"")

2. Quindi, trascina il quadratino di riempimento verso il basso sulle celle finché non vengono visualizzate celle vuote e ora sono stati elencati tutti i valori univoci basati sul criterio specifico, vedi screenshot:

Nota: Nella formula precedente: B2: B15 è l'intervallo di colonne che contiene i valori univoci da cui si desidera estrarre, A2: A15 è la colonna che contiene il criterio su cui ti sei basato, D2 indica il criterio su cui si desidera elencare i valori univoci in base a, e E1 è la cella sopra la formula inserita.

Estrai valori univoci in base a più criteri con la formula di matrice

Se vuoi estrarre i valori univoci in base a due condizioni, ecco un'altra formula di matrice che può farti un favore, per favore fai come segue:

1. Immettere la formula seguente in una cella vuota in cui si desidera elencare i valori univoci, in questo esempio, la inserirò nella cella G2, quindi premere Maiusc + Ctrl + Invio chiavi per ottenere il primo valore univoco.

=IFERROR(INDEX($C$2:$C$15,MATCH(0,COUNTIF(G1:$G$1,$C$2:$C$15)+IF($A$2:$A$15<>$E$2,1,0)+IF($B$2:$B$15<>$F$2,1,0),0)),"")

2. Quindi, trascina il quadratino di riempimento verso il basso sulle celle finché non vengono visualizzate celle vuote e ora sono stati elencati tutti i valori univoci basati sulle due condizioni specifiche, vedi screenshot:

Nota: Nella formula precedente: C2: C15 è l'intervallo di colonne che contiene i valori univoci da cui si desidera estrarre, A2: A15 ed E2 sono il primo intervallo con i criteri su cui desideri estrarre valori univoci in base, B2: B15 ed F2 sono il secondo intervallo con i criteri su cui si desidera estrarre valori univoci basati su e G1 è la cella sopra la formula inserita.

Estrai valori univoci da un elenco di celle con una funzione utile

A volte, vuoi solo estrarre i valori univoci da un elenco di celle, qui, ti consiglierò uno strumento utile-Kutools for Excel, Con la sua Estrai celle con valori univoci (includi il primo duplicato) utility, puoi estrarre rapidamente i valori univoci.

Nota:Per applicare questo Estrai celle con valori univoci (includi il primo duplicato), in primo luogo, dovresti scaricare il file Kutools for Excele quindi applica la funzione in modo rapido e semplice.

Dopo l'installazione Kutools for Excel, per favore fai come questo:

1. Fare clic su una cella in cui si desidera visualizzare il risultato. (Note:: Non fare clic su una cella nella prima riga.)

2. Quindi fare clic Kutools > formula Helper > formula Helper, vedi screenshot:

3. Nel Formule Helper finestra di dialogo, eseguire le seguenti operazioni:

  • Seleziona Testo opzione dal Formula Tipologia menu `A tendina;
  • Quindi scegli Estrai celle con valori univoci (includi il primo duplicato) dal Scegli una fromula casella di riepilogo;
  • In destra Input di argomenti sezione, seleziona un elenco di celle da cui desideri estrarre valori univoci.

4. Quindi fare clic Ok pulsante, il primo risultato viene visualizzato nella cella, quindi seleziona la cella e trascina il quadratino di riempimento sulle celle in cui desideri elencare tutti i valori univoci finché non vengono visualizzate celle vuote, vedi screenshot:

Scarica subito Kutools per Excel!


Articoli più relativi:

  • Contare il numero di valori univoci e distinti da un elenco
  • Supponendo che tu abbia un lungo elenco di valori con alcuni elementi duplicati, ora, vuoi contare il numero di valori univoci (i valori che compaiono nell'elenco solo una volta) o valori distinti (tutti i diversi valori nell'elenco, significa unico valori + 1 ° valore duplicato) in una colonna come mostrato nell'immagine a sinistra. In questo articolo, parlerò di come affrontare questo lavoro in Excel.
  • Sommare i valori univoci in base ai criteri in Excel
  • Ad esempio, ho un intervallo di dati che contiene le colonne Nome e Ordine, ora, per sommare solo valori univoci nella colonna Ordine in base alla colonna Nome come mostrato nella seguente schermata. Come risolvere questa attività rapidamente e facilmente in Excel?
  • Valori univoci concatenati in Excel
  • Se ho un lungo elenco di valori che è stato popolato con alcuni dati duplicati, ora voglio trovare solo i valori univoci e quindi concatenarli in una singola cella. Come posso affrontare questo problema rapidamente e facilmente in Excel?

I migliori strumenti per la produttività in ufficio

🤖 Assistente AI di Kutools: Rivoluziona l'analisi dei dati basandosi su: Esecuzione intelligente   |  Genera codice  |  Crea formule personalizzate  |  Analizzare i dati e generare grafici  |  Richiama le funzioni di Kutools...
Funzioni popolari: Trova, evidenzia o identifica i duplicati   |  Elimina righe vuote   |  Combina colonne o celle senza perdere dati   |   Round senza formula ...
Super ricerca: VLookup a criteri multipli    VLookup a valori multipli  |   VLookup su più fogli   |   Ricerca fuzzy ....
Elenco a discesa avanzato: Crea rapidamente un elenco a discesa   |  Elenco a discesa dipendente   |  Elenco a discesa a selezione multipla ....
Gestore di colonna: Aggiungi un numero specifico di colonne  |  Sposta colonne  |  Attiva/disattiva lo stato di visibilità delle colonne nascoste  |  Confronta intervalli e colonne ...
Funzionalità in primo piano: Messa a fuoco della griglia   |  Vista di progettazione   |   Grande barra delle formule    Gestore di cartelle di lavoro e fogli   |  Resource Library (Testo automatico)   |  Date picker   |  Combina fogli di lavoro   |  Crittografa/decrittografa le celle    Invia e-mail per elenco   |  Super filtro   |   Filtro speciale (filtro grassetto/corsivo/barrato...) ...
I 15 migliori set di strumenti12 Testo Strumenti (aggiungi testo, Rimuovi personaggi, ...)   |   50+ Grafico Tipi (Diagramma di Gantt, ...)   |   40+ Pratico Formule (Calcola l'età in base al compleanno, ...)   |   19 Inserimento Strumenti (Inserisci il codice QR, Inserisci immagine dal percorso, ...)   |   12 Conversione Strumenti (Numeri in parole, Conversione di valuta, ...)   |   7 Unisci e dividi Strumenti (Combina righe avanzate, Celle divise, ...)   |   ... e altro ancora

Potenzia le tue competenze di Excel con Kutools per Excel e sperimenta l'efficienza come mai prima d'ora. Kutools per Excel offre oltre 300 funzionalità avanzate per aumentare la produttività e risparmiare tempo.  Fai clic qui per ottenere la funzionalità di cui hai più bisogno...

Descrizione


Office Tab porta l'interfaccia a schede in Office e semplifica notevolmente il tuo lavoro

  • Abilita la modifica e la lettura a schede in Word, Excel, PowerPoint, Publisher, Access, Visio e Project.
  • Apri e crea più documenti in nuove schede della stessa finestra, piuttosto che in nuove finestre.
  • Aumenta la produttività del 50% e riduce ogni giorno centinaia di clic del mouse!
Comments (40)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you so much. This was very very helpful. You Rock!!
This comment was minimized by the moderator on the site
hi everyone..
i have problem..
i got blank result even i press ctrl shift enter together..
This comment was minimized by the moderator on the site
Hi all, Can some help me to get all unique values on one single cell
This comment was minimized by the moderator on the site
Hi, this worked well! Although it takes Excel sooooo long to calculate. Just dragging down 15 cells in a column takes about 15min to calculate... if not longer. Is this normal? If this becomes dynamic it will take a hell of alot of computing time.
This comment was minimized by the moderator on the site
Hello. This is really helpful, however, what If I want a formula that lists the unique values based on multiple criteria. eg. I have a data set which has the following data in a table (after each hyphen is a new column but same row):

Company A - £200 - £100
Company A - £300 - £200
Company B - £300 - £200
Company C - £600 - £200
Company B - £100 - £300
Company D - £0 - £600
Company A - £700 - £100

I want a new data table in a new tab which groups the duplicate values without using an array formula. currently I'm grouping using a pivot table and pasting to my new data table. It's a long process but array formulas make my spreadsheet really slow.

Company A - £1200 - £400
Company B - £400 - £500
Company C - £600 - £200
Company D - £0 - £600

Thanks,
K
This comment was minimized by the moderator on the site
Hello, K,
For solving your problem, I can recommend our useful tool- Kutools for Excel, with its Advanced Combine Rows feature, you can deal with this job quickly. Firstly, you should copy and paste your data into a new worksheet, and then apply htis feature as below screenhsot shown.
You can know more about this feature from: https://www.extendoffice.com/product/kutools-for-excel/excel-combine-duplicate-rows.html
Please download Kutools for Excel and install it, then apply this feature. Full feature free trial 30-day, please try.
This comment was minimized by the moderator on the site
Hi! the formula works really well. I would like to add another criterion, i mean, get the unique answers but using two criteria
This comment was minimized by the moderator on the site
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!
This comment was minimized by the moderator on the site
Hi. I am using the two conditions formula =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)), "") to extract a unique list and it works great, but I am struggle to add the SMALL function to get the list sorted as well in ascending order. Are you able to help?
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
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!
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
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!
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
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!
This comment was minimized by the moderator on the site
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!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations