Formula to extract unique values to an array

  • Thread starter Thread starter QB
  • Start date Start date

QB

Board Regular
Joined
Jul 5, 2004
Messages
93
Hi

I have a column A1 to A750 with many duplicated values. I need a formula to extract the unique values from this column to an array. I want to use the array to act as a data validation list.

I would like to avoid using advanced filtering if possible.

Any help would be much appreciated.

QB
 
Note:

In case there are blank cells in the list, we have to exclude them.

In this case, replace the formula in B2 with:

=IF(ROWS($B$1:B2)>$C$1,"",INDEX(A:A,MIN(IF($A$2:$A$750<>"",IF(ISNA(MATCH($A$2:$A$750,$B$1:B1,0)),ROW($A$2:$A$750))))))

... confirmed with CSE
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi

Thanks for your response. I have tried it out but there seems to be a problem. Cell B1 entered as an array formula returns the number of unique values in the range. Cell B2 and the cells below return no value.

I have tried to trace the problem without success. I can see that the name Rvec and cell B1 do seem to generate arrays with the what look like a partial solution. After that I'm stuck - though the reference to cell $C$4 in the formula in B2 does confuse me.

I do hope that you can help me again.

Regards

QB

The formula in B2 refers to a wrong cell. It should be:

Control+shift+enter (not just enter) and copy down...
Rich (BB code):
=IF(ROWS($B$2:B2)<=$B$1,INDEX($A$1:$A$750,
   SMALL(IF(FREQUENCY(IF($A$1:$A$750<>"",
    MATCH("~"&$A$1:$A$750&"",$A$1:$A$750&"",0)),Rvec),Rvec),
      ROWS($B$2:B2))),"")
 
Upvote 0
Thanks to all who helped. The final suggestion worked but I decided to take your advice and use the Advance Filter in the end.

Regards

QB
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

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