Formula Errors

How to Fix VLOOKUP #N/A Error When Finding the Maximum Value

Kushani NimanthikaKushani Nimanthika Nov 11, 2026 869 views

Question details

The user is encountering an #N/A error when using VLOOKUP combined with the MAX function to return an item corresponding to the maximum value in a dataset.

How to Fix VLOOKUP #N/A Error When Finding the Maximum Value
Product
Spreadsheet
Device & OS
not provided
Scenario
Trying to find the maximum value in a specific column and return the corresponding label or item from a column to its left.
Observed behavior
The formula =VLOOKUP(MAX(H5:H14),C5:H14,1,FALSE) returns an #N/A error because VLOOKUP only searches the first column of the specified range, which does not contain the maximum value.
Before you start

Ensure that your dataset does not contain any existing error values in the lookup column, as these can interfere with the MAX and MATCH functions.

Solution 1Recommended

Use INDEX and MATCH to Find the Maximum Value

Replace VLOOKUP with a combination of INDEX and MATCH, which allows you to look up values from right to left without being restricted to the first column.

VLOOKUP is designed to search only the first column of a given range and return a value to its right. When your lookup value (the maximum value) is in a column to the right of your return value, VLOOKUP will fail and return #N/A. The INDEX and MATCH combination overcomes this limitation by separating the column you want to return from the column you are searching.

1
Select the target cell

Click on the cell where you want the result to appear.

2
Enter the INDEX and MATCH formula

Type the formula =INDEX(C5:C14,MATCH(MAX(H5:H14),H5:H14,0)) into the formula bar.

3
Press Enter

Press Enter to apply the formula. The MATCH function will find the row position of the maximum value in column H, and the INDEX function will return the corresponding item from column C.

Use INDEX and MATCH to Find the Maximum Value
Formula Breakdown: INDEX defines the column to return the value from (C5:C14), while MATCH locates the exact row of the MAX value in the lookup column (H5:H14).
Advanced Formulas in WPS Spreadsheet

Easily Handle Complex Formulas with WPS Spreadsheet

WPS Spreadsheet fully supports advanced functions like VLOOKUP, INDEX, MATCH, and MAX. It provides an intuitive formula builder and error-checking tools to help you troubleshoot #N/A errors quickly.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the data.
  2. 2. Use the Insert Function tool: Click the 'Formulas' tab and select 'Insert Function' to easily search for INDEX and MATCH.
  3. 3. Input the formula arguments: Follow the on-screen prompts to select your arrays and lookup values without worrying about syntax errors.
Fully compatible with Microsoft Excel formulas and functionsBuilt-in formula error checking and evaluation toolsLightweight and fast performance for large datasetsFree to use with a familiar, user-friendly interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does VLOOKUP return #N/A when the value clearly exists?

VLOOKUP only searches for the lookup value in the very first column of your specified table array. If the value you are looking for (like the MAX value) is in a different column, VLOOKUP cannot find it and returns an #N/A error.

Can VLOOKUP search from right to left?

No, VLOOKUP is strictly designed to search the first column and return a value from a column to its right. To perform a leftward lookup, you must use the INDEX and MATCH functions or the newer XLOOKUP function.

What does the '0' mean in the MATCH function?

The '0' in the MATCH function specifies an exact match. It tells the formula to find the exact maximum value in the specified range, ensuring accurate results rather than an approximate match.