How to Return the First Value Greater Than Another in Excel
Question details
The user needs a formula to find the first value in one column that exceeds the corresponding value in another column, retrieve a related value (such as a date), and highlight the matching cell.
- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Comparing two columns of numbers row-by-row to extract corresponding data based on the first occurrence of a greater-than condition.
- Observed behavior
- The user requires an array formula using INDEX and MATCH to evaluate the condition, retrieve the correct value, and apply conditional formatting.
Ensure your data columns are properly aligned and contain numeric values. If you are using older versions of Excel, keep in mind that array formulas require a specific keystroke combination to calculate correctly.
Use an INDEX and MATCH Array Formula
Combine the INDEX and MATCH functions into an array formula to compare two columns and return the first matching value.
This method evaluates the condition across the entire specified range. Because it performs a row-by-row comparison, it must be entered as an array formula in older versions of Excel.
Click on the cell where you want the resulting value to be displayed.
Type the formula =INDEX(B1:B7,MATCH(TRUE,B1:B7>A1:A7,0)) into the formula bar. Adjust the ranges B1:B7 and A1:A7 to match your actual data columns.
Do not simply press Enter. Instead, press Ctrl + Shift + Enter simultaneously. Excel will wrap the formula in curly braces {}, indicating it is an array formula.
Return a Related Value (e.g., Date) from Another Column
Adjust the INDEX range of your formula to return a corresponding value, such as a date, from a different column in the same row.
Highlight the Matching Cell with Conditional Formatting
Use conditional formatting to visually identify the first cell in a column that exceeds the corresponding value in another column.
Use WPS Spreadsheet to Easily Compare Column Data
WPS Office offers robust support for array formulas, conditional formatting, and all standard functions like INDEX and MATCH. You can perform complex data comparisons seamlessly and accurately using WPS Spreadsheet.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your data columns.
- 2. Input the array formula: Select the target cell, enter your INDEX and MATCH formula, and press Ctrl+Shift+Enter.
- 3. Apply Conditional Formatting: Navigate to the Home tab, click Conditional Formatting, and set up your highlighting rules using the exact same formula.

Frequently Asked Questions
Why does my formula return a #VALUE! or #N/A error?
If you see a #VALUE! error, you likely forgot to confirm the formula with Ctrl+Shift+Enter, which is required for array formulas in older versions of Excel. An #N/A error means that none of the values in the first column were greater than the corresponding values in the second column.
Can I return just the row number instead of the value?
Yes. To get the relative row number where the condition is first met, remove the INDEX function and use only the MATCH portion: =MATCH(TRUE,B1:B7>A1:A7,0).
How do I evaluate the entire column instead of a specific range?
You can use full column references in your formula, such as =INDEX(B:B,MATCH(TRUE,B:B>A:A,0)). However, using whole column references in array formulas can sometimes slow down calculation speed in large worksheets, so specific ranges are often recommended.




