Building a list of unique values from a list, without using a Pivot Table.

zapppsr

Board Regular
Joined
Aug 19, 2010
Messages
189
I need to extract the unique values from a list (where they are repeated), and build a list of those unique values.

The formula must run the vehicle column on table 1 and get the unique values and build a list of them on table 2. I'm aware that I will have to define a number of unique types I will want... For instance, my table 2 will have 12 fields because I know there are not more then 12 types of vehicles.

Below, an exemple of the data and desired result:

fakepivot.jpg


Thanks in advance. I know I can count on you guys.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
take a look at the auto filter advanced function, to copy to another location unique values
 
Upvote 0
Since you know there are 12 different types of vehicles, can't you just hardcode it in?
For example,
In D1, you can type
=IF(ISERROR(MATCH("Car", $A:$A, 0)),"","Car")

and in D2, you can type
=IF(ISERROR(MATCH("Bus", $A:$A, 0)),"","Bus")

Otherwise, I can't think of a way to use only built-in formulas to get unique values automatically.
But then again, MrExcel MVPs always manage to surprise me ;)
 
Last edited:
Upvote 0
In your formula, you mention the names of the vehicles. Consider the name of vehicles unknown. I don't know what is in table 1, so I cant use the names in the formula.

Since you know there are 12 different types of vehicles, can't you just hardcode it in?
For example,
In D1, you can type
=IF(ISERROR(MATCH("Car", $A:$A, 0)),"","Car")

and in D2, you can type
=IF(ISERROR(MATCH("Bus", $A:$A, 0)),"","Bus")

Otherwise, I can't think of a way to use only built-in formulas to get unique values automatically.
But then again, MrExcel MVPs always manage to surprise me ;)
 
Upvote 0
Hmmm, I know how to get dupes when you can allow spaces inbetween.

Something like
=IF(COUNTIF($A$1:A1,A1)=1,A1,"")

but then you would have to copy down for the entire column, which means it would look like
1
1
1
1
22
2
33
3

<tbody>
</tbody>
 
Upvote 0
Assumptions:
Your table1 is in A1:A25 including headers.

Formula:
=INDEX($A$1:$A$25,SMALL(IF(FREQUENCY(MATCH($A$2:$A$25,$A$2:$A$25,0),MATCH($A$2:$A$25,$A$2:$A$25,0))>0,ROW($A$2:$A$26)),ROWS($E$2:$E2)))
This is an ARRAY formula so it needs to be CSE'd (CONTROL + SHIFT + ENTER keys to be used in place of plain ENTER). Please pay attention to RED marked part, this is needed as FREQUENCY generates an extra element!!!
 
Upvote 0
try this


Excel 2003
HI
6Responsibility CodeUnique
744
846
9412
10417
11418
126
136
1412
1512
1612
1712
1812
1912
2012
2117
2217
2317
2418
2518
2618
2718
Sheet1
 
Upvote 0
Thank you very much for your effort and all who are helping. Your formula is very intelligent.

I got here so far:

fp.jpg


I adjusted the references carefully to match this data including the red cell. Used CTRL ENTER.

Am I missing something?

Assumptions:
Your table1 is in A1:A25 including headers.

Formula:
=INDEX($A$1:$A$25,SMALL(IF(FREQUENCY(MATCH($A$2:$A$25,$A$2:$A$25,0),MATCH($A$2:$A$25,$A$2:$A$25,0))>0,ROW($A$2:$A$26)),ROWS($E$2:$E2)))
This is an ARRAY formula so it needs to be CSE'd (CONTROL + SHIFT + ENTER keys to be used in place of plain ENTER). Please pay attention to RED marked part, this is needed as FREQUENCY generates an extra element!!!
 
Upvote 0

Forum statistics

Threads
1,221,561
Messages
6,160,495
Members
451,653
Latest member
agata

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top