The formula in cell D3 extracts unique distinct values sorted A to Z, from column B to column D. Unique distinct values are all values except duplicates.

Example, in column B value "DD" exists twice in cell B3 and B11. In column D value "DD" exists only once since it is a unique distinct list.

Array formula in cell D3:

=INDEX($B$3:$B$11, MATCH(SMALL(IF(COUNTIF($D$2:D2, $B$3:$B$11)=0, COUNTIF($B$3:$B$11, "<"&$B$3:$B$11), ""), 1), COUNTIF($B$3:$B$11, "<"&$B$3:$B$11), 0))

Watch a video that explains how to use it and how it works:

Learn how to filter values with a condition and return unique distinct values sorted from A to Z:

Unique distinct list sorted alphabetically and based on a condition

The array formula in cell E6 filters values in column C based on value in cell E3, the output is […]

Comments(1) Filed in category: Excel, VLOOKUP and return multiple values

Sort a multi-column cell range alphabetically:

Sort a range from A to Z using array formula in excel

Question: How do I sort a range alphabetically using excel array formula? Answer: Array formula in B8: =INDEX($B$2:$E$5, MIN(IF(SMALL(COUNTIF($B$2:$E$5, "<"&$B$2:$E$5), […]

Comments(3) Filed in category: Excel, Sort values

Sort text, numbers and ignore blanks, from A to Z

Sorting numbers and text cells also removing blanks using an array formula

Question: How do I sort text and numbers and also removing blanks using an array formula? Answer: Array formula in […]

Comments(22) Filed in category: Excel

Sort a cell range by frequency:

Sort a range by occurence using array formula in excel

Learn how to sort cell values by frequency.

Comments(4) Filed in category: Excel, Sort values

How to create an array formula

  1. Double click on cell D3
  2. Copy (Ctrl +c) amd paste (Ctrl+v) above formula to cell D3
  3. Press and hold Ctrl + Shift simultaneously
  4. Press Enter once
  5. Release all keys

The formula in the formula bar should now look like this: {=formula}
Don't enter the curly brackets yourself, they appear automatically.

Learn the basics of Excel arrays

Array formulas allows you to do advanced calculations not possible with regular formulas.

Comments(2) Filed in category: Count values, Excel

How to copy array formula

  1. Select cell D3
  2. Copy cell  (Keyboard shortcut: Ctrl + c)
  3. Select cell range D4:D7
  4. Paste (Keyboard shortcut: Ctrl + v)

Explaining array formula in cell

Step 1 - Identify values not yet shown above current cell

Cell range $D$2:D2 changes as the formula is copied down to cells below. This makes it possible to avoid duplicate values in the list.

COUNTIF($D$2:D2,$B$3:$B$11)=0

becomes

COUNTIF("Unique list sorted alphabetically",{"DD";"EE";"FF";"EE";"GG";"BB";"FF";"GG";"DD"})=0

becomes

{0;0;0;0;0;0;0;0;0}=0

and returns

{TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE}

COUNTIF function

Counts the number of times a value exists in a cell range.

Comments(5) Filed in category: Excel

Step 2 - Create an array with a ranking sort number

COUNTIF($B$3:$B$11,"<"&$B$3:$B$11)

becomes

{1;3;5;3;7;0;5;7;1}

Step 3 - Convert array with not displayed values to an array containing rank numbers

IF(COUNTIF($D$2:D2,$B$3:$B$11)=0,COUNTIF($B$3:$B$11,"<"&$B$3:$B$11),"")

becomes

IF({TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE},{1;3;5;3;7;0;5;7;1},"")

and returns

{1;3;5;3;7;0;5;7;1}

IF function explained

Check if a logical expression is met. Returns a specific value if TRUE and another specific value if FALSE.

Comments(9) Filed in category: Excel

Step 4 - Find the smallest value in array

SMALL(IF(COUNTIF($D$2:D2, $B$3:$B$11)=0, COUNTIF($B$3:$B$11,"<"&$B$3:$B$11), ""),1)

becomes

SMALL({1;3;5;3;7;0;5;7;1},1)

and returns 0.

SMALL function and LARGE function

This function lets you extract any number in a cell range based on sort rank.

Comments(12) Filed in category: Excel

Step 5 - Find relative position in the array

MATCH(SMALL(IF(COUNTIF($D$2:D2, $B$3:$B$11)=0, COUNTIF($B$3:$B$11,"<"&$B$3:$B$11),""), 1),COUNTIF($B$3:$B$11, "<"&$B$3:$B$11), 0)

becomes

MATCH(0,COUNTIF($B$3:$B$11, "<"&$B$3:$B$11), 0)

becomes

MATCH(0,{1;3;5;3;7;0;5;7;1}, 0)

and returns 6.

MATCH function

Identify the position of a value in an array.

Comments(12) Filed in category: Excel

Step 6 - Return value in data based on row coordinate

INDEX($B$3:$B$11, MATCH(SMALL(IF(COUNTIF($D$2:D2, $B$3:$B$11)=0, COUNTIF($B$3:$B$11, "<"&$B$3:$B$11), ""), 1), COUNTIF($B$3:$B$11, "<"&$B$3:$B$11), 0))

becomes

INDEX($B$3:$B$11, 6)

becomes

INDEX({"DD"; "EE"; "FF"; "EE"; "GG"; "BB"; "FF"; "GG"; "DD"}, 6)

and returns BB in cell D3.

INDEX function explained

Fetch a value in a data set based on coordinates.

Comments(14) Filed in category: Cross reference table, Excel, INDEX function

Download excel *.xlsx file

Unique distinct list sorted alphabetically.xlsx

Recommended article

5 easy ways to extract unique distinct values

Update: 30 Aug, 2017h You have quite a few options to choose from if you are looking for a way […]

Comments(149) Filed in category: Advanced filter, Excel, Unique distinct values, Unique values