How to Return the Date of the First Negative Value in Excel
Question details
The user needs a formula to locate the first negative value in a row and return the date from the corresponding column header, while avoiding #NAME? errors in older versions like Excel 2016.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Tracking financial or inventory data where the user needs to pinpoint the exact date a metric drops below zero.
- Observed behavior
- Using newer Excel lookup functions results in a #NAME? error because the functions are unsupported in older software versions.
Ensure your dataset is organized correctly, with dates in the top header row and the numeric values in the rows directly below. Verify that your numbers are formatted as numerical values and not as text.
Use an INDEX and MATCH Array Formula (Excel 2016 Compatible)
This approach uses standard INDEX and MATCH functions combined with a logical condition, which works perfectly in older versions of Excel without triggering a #NAME? error.
Since older versions of Excel do not support dynamic arrays natively, this specific formula requires an array entry to evaluate the condition across multiple cells simultaneously.
Click on the cell where you want the date of the first negative value to be displayed.
Type the formula =INDEX($B$1:$Z$1, MATCH(TRUE, B2:Z2 < 0, 0)), ensuring you replace '$B$1:$Z$1' with your absolute date header range and 'B2:Z2' with the specific row of values you are checking.
Instead of simply pressing Enter, you must press Ctrl + Shift + Enter. Excel will automatically wrap your formula in curly braces { } to indicate it is an array formula.
If the result appears as a random 5-digit number, right-click the cell, select 'Format Cells', and choose 'Date'.

Use XLOOKUP for Newer Excel Versions
If you upgrade your software or share the file with a user on Microsoft 365 or Excel 2021, XLOOKUP provides a cleaner way to achieve this without needing array entry.
Find Data Instantly with WPS Spreadsheet
WPS Office offers robust formula support, fully compatible with both legacy array formulas and modern lookup functions like XLOOKUP. You can quickly analyze your financial or project data without encountering version compatibility errors.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your dataset containing the dates and numeric values.
- 2. Enter the lookup formula: Click on your target cell and type =INDEX($B$1:$Z$1, MATCH(TRUE, B2:Z2 < 0, 0)).
- 3. Apply the formula: Press Ctrl + Shift + Enter to correctly apply it as an array formula.
- 4. Format the cell correctly: Go to the Home tab, click the Number Format dropdown, and select Short Date to display the result properly.

Frequently Asked Questions
Why does my formula return a #NAME? error in Excel 2016?
The #NAME? error occurs when you try to use a function (such as XLOOKUP or FILTER) that was introduced in newer versions of Excel. Excel 2016 does not recognize the function name. To fix this, use the backwards-compatible INDEX and MATCH combination instead.
What if there are no negative values in the row?
If the formula searches the row and does not find a value below zero, the MATCH function will return an #N/A error. You can handle this gracefully by wrapping your formula in an IFERROR function, for example: =IFERROR(INDEX(...), "None").
Why does the returned date look like a 5-digit number?
Spreadsheet programs store dates as sequential serial numbers for calculation purposes (e.g., 44567 represents a specific date in 2022). If you see a number instead of a date, simply select the cell, go to the Home tab, and change the Number Format from General to Date.




