Function Problems

Consolidate Row Values into One Column with an Excel Formula

Olivia MillerOlivia Miller Dec 2, 2026 868 views

Question details

Find a formula that returns the first nonblank value from each row in a single output column.

Consolidate Row Values into One Column with an Excel Formula
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the output cell

Click an empty cell outside the source range, such as J2 if the values are in A2:I2.

2
Enter the formula

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.

3
Confirm the formula

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.

4
Fill down

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.

Use INDEX and MATCH to return the first nonblank cell in each row
Rows with no nonblank cells: If every cell in the range is blank, the formula returns #N/A. To return an empty result instead, use =IFERROR(INDEX(A2:I2,MATCH(1,N(NOT(ISBLANK(A2:I2))),0)),""). Confirm it as an array formula in older Excel versions.
Work with spreadsheets in WPS

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. 1. Open the worksheet: Open WPS Spreadsheet and use Menu > Open to select your Excel workbook.
  2. 2. Choose an output cell: Click an empty cell outside the source range, such as J2 for data in A2:I2.
  3. 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. 4. Fill the results down: Drag the fill handle from the output cell down to apply the formula to the other rows.
Consolidate row values into one column without copying each entry manuallyOpen and edit Microsoft Excel XLSX and XLS filesFill formulas down across multiple rowsWork in a familiar spreadsheet interface
microsoft office alternative - wps office

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.