Author: Oscar Cronquist Article last updated on December 07, 2010

Identify largest text values

Array formula in B2:

=IF(ROWS(B2:$B$2)>ROWS(List), "", INDEX(List, MATCH(LARGE(IF(MAX(LEN(List))=LEN(List), (LEN(List)&","&ROW(List))*1, ""), ROWS(B2:$B$2)), IF(MAX(LEN(List))=LEN(List), (LEN(List)&","&ROW(List))*1, ""), 0))) + CTRL + SHIFT + ENTER

copied down as far as needed.

Named ranges
List (A2:A19)
What is named ranges?

How to customize the formula to your excel spreadsheet
Change the named range. If your unique list starts at F3, change B2:$B$2 in the above array formula to $F$2:F2

Download excel sample file for this tutorial.
Largest text values.xls
(Excel 97-2003 Workbook *.xls)

Functions in this article:

MATCH(lookup_value;lookup_array; [match_type]
Returns the relative position of an item in an array that matches a specified value

Returns a value or reference of the cell at the intersection of a particular row and column, in a given range

Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE

ROW(reference) returns the rownumber of a reference

Counts the number of cells within a range that meet the given condition

Returns the largest value in a set of values. Ignores logical values and text.

Changes FALSE to TRUE or TRUE to FALSE

Returns the number of characters in a text string

LARGE(array,k) returns the k-th largest row number in this data set

ROWS(array) returns the number of rows in a reference or an array