How to Find the Value in Column A Associated with the Maximum in Column B in Excel
Question details
The user needs to retrieve a value from Column A that corresponds to the highest value located in Column B.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Performing data analysis that requires extracting corresponding row data based on the highest numeric value in a specific column.
- Observed behavior
- The user wants to output the corresponding Column A value into a separate target cell when the maximum value in Column B is identified.
Ensure your data does not contain merged cells across columns A and B, and verify that Column B contains numeric values rather than text-formatted numbers.
Use the XLOOKUP Function (Modern Excel)
The XLOOKUP function combined with MAX is the most straightforward method for Microsoft 365 and newer versions of Excel.
XLOOKUP is a powerful and flexible function that replaces older lookup formulas. It naturally handles right-to-left lookups, allowing you to search in Column B and return a value from Column A without rearranging your data.
Click on the empty cell where you want the resulting value to be displayed.
Type the formula =XLOOKUP(MAX(B:B),B:B,A:A) into the formula bar.
Press the Enter key. The cell will now display the value from Column A that matches the highest number in Column B.

Use the INDEX and MATCH Functions (All Excel Versions)
If you are using an older version of Excel that does not support XLOOKUP, the classic INDEX and MATCH combination works perfectly.
Easily Analyze Data with WPS Spreadsheet
WPS Spreadsheet fully supports advanced functions like XLOOKUP, INDEX, MATCH, and MAX. You can seamlessly open your files and apply these formulas to find associated values without any compatibility issues.
- 1. Open Your Data in WPS: Launch WPS Office and open your spreadsheet file in the WPS Spreadsheet module.
- 2. Select a Output Cell: Click on any empty cell where you want to display the matched value.
- 3. Input the Lookup Formula: Type =XLOOKUP(MAX(B:B), B:B, A:A) into the cell.
- 4. Get Your Result: Press Enter to instantly retrieve the corresponding value from Column A.

Frequently Asked Questions
What if there are multiple maximum values in Column B?
Both the XLOOKUP and INDEX/MATCH formulas will return the corresponding value for the first maximum value encountered, searching from the top of the column to the bottom.
Can I search for the minimum value instead?
Yes, you can simply replace the MAX function with the MIN function in either formula. For example, use =XLOOKUP(MIN(B:B),B:B,A:A).
Why does my INDEX MATCH formula return an #N/A error?
This typically happens if there are text values or pre-existing error values in Column B that disrupt the MAX function's calculation. Ensure Column B contains only clean numeric data.
Do I need to select the entire column (A:A) for the formula?
No. While selecting the entire column is easier to type, it is generally recommended to restrict the range to your actual data (e.g., A2:A100 and B2:B100) to improve spreadsheet calculation speed.




