Retrieve unique items array

L

Legacy 143009

Guest
Hi,

There are formulas already to extract unique items from a range but all of them are based/depends on comparing the list column reference by COUNTIF.

Is there anyway to retrieve a unique array alone, for example may work in TEXTJOIN function?


E.g. TEXTJOIN(", ",0,UNIQUEFUNCTION)

Thanks a lot!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Suggesting TEXTJOIN indicates that you may want all the unique items listed in a single cell. Is that your requirement? Or are you looking for ways to list them down a column?
Is the original list in separate cells a column?
 
Upvote 0
As I mentioned in my post, listing to a seperate column depends on the listed column reference.

TEXTJOIN is not important. It was just an example. Theoretically I want to have {"uniqueItem1", "uniqueItem2", "uniqueItem3"} array in the end.
 
Upvote 0
Not sure what you want

See if this example helps

Data

A
1
Names​
2
Anthony​
3
Bob​
4
Mary​
5
Mike​
6
Robert​
7
Anthony​
8
Robert​
9
Bob​
10
Mary​
11
Mary​

Paste this formula in the Formula Bar and press F9
=IF(FREQUENCY(MATCH(A2:A11,A2:A11,0),ROW(A2:A11)-ROW(A2)+1),A2:A11,"")

You see...
={"Anthony";"Bob";"Mary";"Mike";"Robert";"";"";"";"";"";""}

M.
 
Upvote 0
Control+shift+enter, not just enter:

=IF(FREQUENCY(IF(1-(range=""),MATCH(range,range,0)),ROW(range)-ROW(INDEX(range,1,1))+1),range)

would deliver an array of unique items from range along with a bunch of FALSE values. This can be processed by feeding to relevant functions.
 
Upvote 0
@Marcelo Branco, your solution is what I need. Thank you very much. It also produces empty array elements but not a big deal. Also it doesn't require Ctrl+Shift+Enter.
TEXTJOIN with ignoring empty values, the result is: Anthony, Bob, Mary, Mike, Robert. (What I need!)
TEXTJOIN without ignoring empty values, the result is: Anthony, Bob, Mary, Mike, Robert, , , , , , .
In fact your actual array is: {"Anthony", "Bob", "Mary", "Mike", "Robert", "", "", "", "", ""}
Thanks a lot again!

@Aladin Akyurek your solution is a bit tricky. It is also an array formula.
TEXTJOIN with ignoring empty values, the result is: Anthony, Bob, Mary, Mike, Robert, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE.Also the same result in TEXTJOIN without ignoring empty values.

Both thanks a lot for your great effert!
 
Upvote 0
@Marcelo Branco, your solution is what I need. Thank you very much. It also produces empty array elements but not a big deal. Also it doesn't require Ctrl+Shift+Enter.
TEXTJOIN with ignoring empty values, the result is: Anthony, Bob, Mary, Mike, Robert. (What I need!)
TEXTJOIN without ignoring empty values, the result is: Anthony, Bob, Mary, Mike, Robert, , , , , , .
In fact your actual array is: {"Anthony", "Bob", "Mary", "Mike", "Robert", "", "", "", "", ""}
Thanks a lot again!

@Aladin Akyurek your solution is a bit tricky. It is also an array formula.
TEXTJOIN with ignoring empty values, the result is: Anthony, Bob, Mary, Mike, Robert, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE.Also the same result in TEXTJOIN without ignoring empty values.

Both thanks a lot for your great effert!

It's the same thing... Additionally, it doesn't include an empty/blank cell as an unique item.
 
Upvote 0
It's the same thing... Additionally, it doesn't include an empty/blank cell as an unique item.
After thinking for a while, I think you are right. Omitting empty/blank cells thumbs up (y)
Also returning pure FALSE values will be absolutely beneficial to evaluate them in other functions.

You are very very right Sir!
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,049
Latest member
THMarana

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