Extract largest values from two columns using array formula in excel
Question: How do I extract the five largest values from two or more columns?
Answer:
Formula in A12:
Formula in B12:
How to create an array formula
- Copy (Ctrl + c) and paste (Ctrl + v) array formula into formula bar.
- Press and hold Ctrl + Shift.
- Press Enter once.
- Release all keys.
Named ranges
tbl (A2:D6)
Use array formula in your excel sheet
Change cell range in the named range. Array formula in cell A12, adjust COUNTIF($B$12:B12,B12) to your sheet.
Explaining array formula
There is a similar formula and explanation on this page:
Unique distinct values from multiple columns using array formula
Download excel example file.
extract-largest-values-from-two-columns
(Excel 97-2003 Workbook *.xls)
Functions in this article
IF(logical_test,[value_if:true],[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE
ROW(reference)
returns the row number of a reference
COUNTIF(range,criteria)
Counts the number of cells within a range that meet the given condition
INDEX(array,row_num,[column_num])
Returns a value or reference of the cell at the intersection of a particular row and column, in a given range
MAX(number1,[number2],)
Returns the largest value in a set of values. Ignores logical values and text.
MATCH(lookup_value;lookup_array; [match_type]
Returns the relative position of an item in an array that matches a specified value
Related blog posts
- Identify largest text value in a column using array formula in excel
- Extract a unique distinct list from two columns using excel 2007 array formula
- Extract a list of duplicates from two columns combined using array formula in excel
- Extract a list of duplicates from three columns combined using array formula in excel
- Extract unique values from a range using array formula in excel







September 17th, 2009 at 6:29 pm
Hi - Thank you for putting this example on line...my question is, how do you change the formula to select the top 5 highest (loses) negitive values first.
Thank you.
July 13th, 2011 at 4:58 pm
Hey -- would you know how to alter this formula so it can find the largest values from your data set but with 3, 4 or 5 columns... i essentially want to scale what you have but for more data
July 14th, 2011 at 2:00 pm
Chris,
Almost two years later...maybe someone else can benefit from my answer.
Array formula in cell A12:
Array formula in cell B12:
Matt,
I think the new formulas work for a larger range now.