To find the maximum value in a column and return a corresponding value from another column, use the array formula =INDEX(return_range, MATCH(MAX(value_range), value_range, 0)). This combination works in all Excel versions and is the most direct replacement for a “VLOOKUP max” because VLOOKUP itself cannot return the row with the largest value without extra steps.
Why VLOOKUP Alone Can’t Do This
VLOOKUP is designed to find the first exact match (or an approximate match when the last argument is TRUE) for a lookup value you already know. It has no built-in way to say “find the maximum number in column B and give me the name from column A.” To get a max-based lookup, you must first calculate the maximum with MAX, then feed that result into VLOOKUP or INDEX/MATCH.
A common attempt is =VLOOKUP(MAX(B2:B100), A2:B100, 2, FALSE). This works only if the maximum value appears exactly once in the lookup column and the lookup column is the first column of the range. If the max repeats, VLOOKUP returns the first occurrence—which may not be the one you want. If your data has the values in column B and names in column A, the range must be reordered or you must use INDEX/MATCH.
The Basic Formula: INDEX and MATCH
Assume your data has names in A2:A20 and scores in B2:B20. To return the name of the person with the highest score, use:
=INDEX(A2:A20, MATCH(MAX(B2:B20), B2:B20, 0))
- MAX(B2:B20) finds the largest score.
- MATCH(…, B2:B20, 0) returns the position of that max (first occurrence if tied).
- INDEX(A2:A20, …) returns the name at that position.
For example, if B2:B20 contains 10, 25, 18, 25, the MAX is 25 and MATCH returns 2 (the first 25), so the result is the name in A3 (assuming A2 is the first data row).
If you want the value itself (not a related cell), just use =MAX(B2:B20).
Handling Ties: Getting All Max Rows
When two or more rows share the maximum value, the formula above returns only the first one. To list all names that match the max, use the FILTER function (Excel 2021 or Microsoft 365):
=FILTER(A2:A20, B2:B20=MAX(B2:B20))
This spills all matching names down the column. In older Excel versions, you can use an array formula with IF and TEXTJOIN, but it’s messy. For a simple count of ties, use =COUNTIF(B2:B20, MAX(B2:B20)).
Using VLOOKUP with MAX: When It Works
If your lookup column (the one containing the values) is the first column of the range, and you only need the first occurrence of the max, then =VLOOKUP(MAX(A2:A20), A2:B20, 2, FALSE) works. Example: column A has scores, column B has names. The formula finds the highest score and returns the name from column B.
But note: VLOOKUP with FALSE requires an exact match. If the max appears twice, it returns the first row. If you need the last occurrence, use LOOKUP(2, 1/(B2:B20=MAX(B2:B20)), A2:A20)—a classic array trick that works in all versions.
Common Errors and How to Fix Them
- #N/A error: The MAX value is not found exactly in the lookup column—often because the lookup column has text-formatted numbers. Select the column and use Text to Columns (Data > Text to Columns) or multiply by 1.
- #VALUE! error: The ranges in MATCH or INDEX are different sizes. Ensure both ranges have the same number of rows.
- Wrong result with ties: If you need all tied rows, use FILTER; otherwise, accept the first occurrence.
- MAX ignores text and blanks: MAX only considers numeric values; text and empty cells are ignored. If your data has errors like #DIV/0!, use
AGGREGATE(4,6,B2:B20)to ignore errors.
Alternatives: XLOOKUP and Dynamic Arrays
In Excel 2021 or Microsoft 365, XLOOKUP can do the same job more cleanly without reordering columns:
=XLOOKUP(MAX(B2:B20), B2:B20, A2:A20)
This searches for the max in B2:B20 and returns the corresponding value from A2:A20. It defaults to the first match, but you can add a fifth argument to search from the bottom: =XLOOKUP(MAX(B2:B20), B2:B20, A2:A20, , , -1).
If you have Microsoft 365, you can also combine SORT and TAKE to get the top N values: =TAKE(SORT(A2:B20, 2, -1), 1) returns the row with the highest score.
Frequently Asked Questions
Can I use VLOOKUP to find the max value? Yes, but only if the column with the max is the first column of the lookup range. Otherwise, use INDEX/MATCH or XLOOKUP.
How do I return the second highest value? Use =LARGE(B2:B20, 2) to get the second largest number, then feed that into INDEX/MATCH or XLOOKUP as the lookup value.
What if my data has duplicate maximums? The standard formula returns the first duplicate. To get all, use FILTER (Microsoft 365) or an array formula with IF.
Does MAX work with dates? Yes, dates are stored as numbers in Excel, so MAX returns the latest date. Use the same INDEX/MATCH pattern to find the name associated with that date.
Why does my formula return #N/A even though the max exists? Often because the lookup column contains numbers stored as text. Convert them to real numbers using the VALUE function or Text to Columns.
Related
- Computer Shortcut Keywords: The Essential List
- Generate 5 Digit Random Number in Python
- C Battery Diameter: Exact Size and What It Means
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Multiply in Excel: Formulas & ExamplesTo multiply in Excel, use the asterisk (*) as the multiplication operator in a formula, such as =A1*B1,…
- Java String Predefined Functions: Methods and ExamplesJava’s predefined string operations are methods of the String class, not standalone functions. Common examples include length(), charAt(),…
- INDEX and VLOOKUP in Excel: How They Work and CompareINDEX and VLOOKUP are both Excel lookup tools: VLOOKUP searches the leftmost column of a range and returns…
- Count Words in Excel: Formulas for Exact and Partial MatchesTo count every occurrence of a word across text in Excel, put the word to find in D1…
- Excel Won’t Let Me Filter by Color? Fixes That WorkExcel usually lets you filter a column by cell color, font color, or icon from its filter drop-down:…
- Split Function in Groovy: How to Use ItThe split() function in Groovy is a method on String that divides the string into an array of…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.