Needed: An Array Formula that returns distinct items from a list

pdx2dca

New Member
Joined
Oct 31, 2017
Messages
10
I need an array function that works much like the column grouping function of a pivot table.


For example: Referencing the list of items below...
Mary
Mary
Bob
John
John
John

<tbody>
</tbody>



...is there an array formula that would return the three distinct items ("Bob", "Mary", "John") from the list? The resulting array would be three cells long, one cell for each distinct item (example below)
Mary
Bob
John

<tbody>
</tbody>
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Let A2:A6 house the data.

In D1 control+shift+ente, not just enter:

=SUM(IF(FREQUENCY(IF(1-($A$2:$A$6=""),MATCH($A$2:$A$6,$A$2:$A$6,0)),ROW($A$2:$A$6)-ROW($A$2)+1),1))

In D2 control+shift+enter, not just enter, and copy down:

=IF(ROWS($D$2:D2)>$D$1,"",INDEX($A$2:$A$6,SMALL(IF(FREQUENCY(IF(1-($A$2:$A$6=""),MATCH($A$2:$A$6,$A$2:$A$6,0)),ROW($A$2:$A$6)-ROW($A$2)+1),ROW($A$2:$A$6)-ROW($A$2)+1),ROWS($D$2:D2))))
 
Upvote 0
That does it. Thanks much.

I looked into using FREQUENCY, but couldn't figure out how to make it work with text. Plus, I misunderstood what the 'bins_array' entry was meant to do.

Thanks again.
 
Upvote 0
That does it. Thanks much.

I looked into using FREQUENCY, but couldn't figure out how to make it work with text. Plus, I misunderstood what the 'bins_array' entry was meant to do.

Thanks again.

You are welcome. Thanks for the update.
 
Upvote 0

Forum statistics

Threads
1,215,727
Messages
6,126,521
Members
449,316
Latest member
sravya

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