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.
 
Adding a little complexity....

Refining what you already gave me, is it possible to add a "filter" based on the types, and only select unique names that are from that specific type?


fake_type.jpg


Glad to know, Mr. Ethan Hunt :cool:
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Re: Adding a little complexity....

Refining what you already gave me, is it possible to add a "filter" based on the types, and only select unique names that are from that specific type?
:
:
I think you should post usable data here so that we don't have to re-build it. To do so, you can either directly paste table data with borders or look for html maker or Excel Jeanie.

Now coming to the formula. Here are two assumptions made and I have assumed rest remains constant like previous post.
  • Adjacent column i.e. $B$6:$B$29 is another named range : vehicle_type
  • Range $G$4 houses the category i.e. {Land, Air, Sea} you will type here.

Following is the formula [ARRAY]:
=IFERROR(INDEX(vehicle_name,SMALL(IF(FREQUENCY(IFERROR(MATCH(vehicle_name&$G$4,vehicle_name&vehicle_type,0),0),IFERROR(MATCH(vehicle_name&$G$4,vehicle_name&vehicle_type,0),-1))>0,ROW(vehicle_name)),ROWS($R$6:$R6))-RefRow),"")

Please notice we need to introduce IFERROR to counter the error that concatenated MATCH throws at us.
 
Upvote 0
Re: Adding a little complexity....

Simply Awesome! You are a genius!

https://dl.dropbox.com/u/33763248/fakepivot_type.xlsx

Sorry for the trouble not posting the data.

I think you should post usable data here so that we don't have to re-build it. To do so, you can either directly paste table data with borders or look for html maker or Excel Jeanie.

Now coming to the formula. Here are two assumptions made and I have assumed rest remains constant like previous post.
  • Adjacent column i.e. $B$6:$B$29 is another named range : vehicle_type
  • Range $G$4 houses the category i.e. {Land, Air, Sea} you will type here.

Following is the formula [ARRAY]:
=IFERROR(INDEX(vehicle_name,SMALL(IF(FREQUENCY(IFERROR(MATCH(vehicle_name&$G$4,vehicle_name&vehicle_type,0),0),IFERROR(MATCH(vehicle_name&$G$4,vehicle_name&vehicle_type,0),-1))>0,ROW(vehicle_name)),ROWS($R$6:$R6))-RefRow),"")

Please notice we need to introduce IFERROR to counter the error that concatenated MATCH throws at us.
 
Upvote 0
Re: Adding a little complexity....

Simply Awesome! You are a genius!

https://dl.dropbox.com/u/33763248/fakepivot_type.xlsx

Sorry for the trouble not posting the data.
Thanks for the feedback.

Here's one more which will work. It is based on mikerickson's approach. It is shorter than my formula and simpler.
=IFERROR(INDEX(vehicle_name,SMALL(IF(IFERROR(MATCH(vehicle_name&$K$3,vehicle_name&vehicle_type,0)=(ROW(vehicle_name)-RefRow),FALSE),ROW(vehicle_name),999),ROWS($S$6:$S6))-RefRow),"")
Pay attention to red part which is row number larger than your data is. I've avoided a function but you can replace it with MAX(ROW(vehicle_name))+1 for adjusting it with all cases.
 
Upvote 0
Re: Adding a little complexity....

Thanks again!

Thanks for the feedback.

Here's one more which will work. It is based on mikerickson's approach. It is shorter than my formula and simpler.
=IFERROR(INDEX(vehicle_name,SMALL(IF(IFERROR(MATCH(vehicle_name&$K$3,vehicle_name&vehicle_type,0)=(ROW(vehicle_name)-RefRow),FALSE),ROW(vehicle_name),999),ROWS($S$6:$S6))-RefRow),"")
Pay attention to red part which is row number larger than your data is. I've avoided a function but you can replace it with MAX(ROW(vehicle_name))+1 for adjusting it with all cases.
 
Upvote 0

Forum statistics

Threads
1,221,560
Messages
6,160,492
Members
451,652
Latest member
Ofnieee

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