Getting Unique Values from List without VBA

Hazelwood

New Member
Joined
Feb 25, 2018
Messages
13
Hi, I'm using Excel (Microsoft 365 on a Mac)

I'm using the formula

=IFERROR(INDEX($B$2:$B$9, MATCH(0,COUNTIF($D$1:D1, $B$2:$B$9), 0)),"")

B1 = Fruit, B2 etc = Apple, Orange, Apple, Banana, Banana, Apple, Pineapple, Peach
D1 = Unique, D2 has the above formula

I copied the example from https://www.extendoffice.com/ into my spreadsheet (will convert to my application once it works)

When I use the formula builder, it shows the result as expected (D2 being Apple, but in my spreadsheet it only shows a blank - I'm stumped as to how to get it to show the first unique value and subsequent values.

Any ideas would be be much appreciated... Hazelwood
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
To list the unique items in the order they appear in the list, enter this array formula in cell D2 and copy down as needed:
Code:
=INDEX($B$2:$B$9,MATCH(0,COUNTIF($D$1:D1,$B$2:$B$9),0))

To list the unique items in alphabetical order, enter this array formula in cell D2 and copy down as needed:
Code:
=INDEX($B$2:$B$9,MATCH(0,COUNTIF($B$2:$B$9,"<"&$B$2:$B$9)-SUM(COUNTIF($B$2:$B$9,"="&D$1:D1)),0))

Note that these are ARRAY formulas. You confirm them to the cell by pressing Ctrl+Shift+Enter, not just with Enter.
 
Last edited:
Upvote 0
To list the unique items in the order they appear in the list, enter this array formula in cell D2 and copy down as needed:
Code:
=INDEX($B$2:$B$9,MATCH(0,COUNTIF($D$1:D1,$B$2:$B$9),0))

To list the unique items in alphabetical order, enter this array formula in cell D2 and copy down as needed:
Code:
=INDEX($B$2:$B$9,MATCH(0,COUNTIF($B$2:$B$9,"<"&$B$2:$B$9)-SUM(COUNTIF($B$2:$B$9,"="&D$1:D1)),0))

Note that these are ARRAY formulas. You confirm them to the cell by pressing Ctrl+Shift+Enter, not just with Enter.

Tom, much appreciated, have a great day ... Hazelwood
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,712
Members
452,995
Latest member
isldboy

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