Consolidate Row Values into One Column with an Excel Formula
Question details
Find a formula that returns the first nonblank value from each row in a single output column.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet has values spread across multiple columns and hundreds of rows, and the user wants one result per row.
- Observed behavior
- The desired output is a column containing the first nonblank entry from each source row.
Identify the source columns and choose an empty output column outside that range. Check whether cells containing formulas that return an empty string should count as nonblank.
Use INDEX and MATCH to return the first nonblank cell in each row
Use this formula to extract the first nonblank cell from left to right and fill the results down one column.
ISBLANK treats a cell containing a formula as nonblank, even if that formula displays an empty string.
Click an empty cell outside the source range, such as J2 if the values are in A2:I2.
In J2, enter =INDEX(A2:I2,MATCH(1,N(NOT(ISBLANK(A2:I2))),0)). Change A2:I2 to match the columns you want to search.
Press Enter in Microsoft 365 or Excel 2021 and later. In older Excel versions, press Ctrl+Shift+Enter to confirm it as an array formula.
Drag the fill handle at the lower-right corner of J2 down through the remaining rows, or double-click it to fill alongside adjacent data.

Extract the First Nonblank Value in WPS Spreadsheet
Use an INDEX and MATCH formula in WPS Spreadsheet to pull the first nonblank cell from each row into a single output column.
- 1. Open the worksheet: Open WPS Spreadsheet and use Menu > Open to select your Excel workbook.
- 2. Choose an output cell: Click an empty cell outside the source range, such as J2 for data in A2:I2.
- 3. Enter the formula: Enter =INDEX(A2:I2,MATCH(1,N(NOT(ISBLANK(A2:I2))),0)) and adjust the range to your data. Press Enter; if your WPS version requires array entry, press Ctrl+Shift+Enter.
- 4. Fill the results down: Drag the fill handle from the output cell down to apply the formula to the other rows.

Frequently Asked Questions
What happens if a row contains more than one value?
The formula returns the first nonblank cell from left to right within the specified range. For A2:I2, it checks column A first and column I last.
Why does the formula return #N/A?
If all cells in the source range are blank, MATCH cannot find a result. Wrap the formula in IFERROR, for example =IFERROR(INDEX(A2:I2,MATCH(1,N(NOT(ISBLANK(A2:I2))),0)),""), to display an empty result instead.
Does the formula skip cells that contain a formula returning an empty string?
No. ISBLANK considers a cell with a formula nonblank, even when the formula displays an empty string.
How do I apply the formula to hundreds of rows?
Enter the formula in the first output cell, then drag its fill handle down or double-click the handle to fill alongside adjacent data. The row references adjust automatically.




