Power Query Problems

How to Extract Nonblank Values from an Excel Matrix

Adam DavisAdam Davis Nov 10, 2026 868 views

Question details

The user needs to transform a 2D data matrix (e.g., years, depths, and measurements) into a normalized, flat table containing one year, depth, and value per row, specifically filtering out any blank values.

How to Extract Nonblank Values from an Excel Matrix
Product
Microsoft Excel
Device & OS
not provided
Scenario
Normalizing a 2D data matrix into a 1D list format for easier data analysis, pivot table creation, or database entry.
Observed behavior
The data is currently arranged in a matrix format with blank intersections, making it difficult to analyze using standard tabular tools.
Before you start

Ensure your matrix has clear, consistent headers for both rows and columns. It is highly recommended to convert your matrix data into an official Excel Table by selecting it and pressing Ctrl+T to ensure seamless data processing.

Solution 1Recommended

Use Power Query to Unpivot the Matrix

Power Query is the most reliable and user-friendly method (available in Excel 2010 and later) to flatten a matrix and automatically filter out empty values.

By utilizing the 'Unpivot Other Columns' feature in Power Query, you can quickly reshape 2D grids into a 1D tabular format. This approach is non-destructive and creates a robust connection that can be refreshed whenever your source data changes.

1
Load data into Power Query

Select your matrix data and navigate to the Data tab. Click on 'From Table/Range' to import your dataset into the Power Query Editor.

2
Select the fixed column

Click on the header of the column that contains your row labels (for example, the 'Depth' column).

3
Unpivot the data

Right-click the selected column header and choose 'Unpivot Other Columns' from the context menu. This will flatten the remaining columns into attribute-value pairs.

4
Rename the columns

Double-click the new column headers to rename them appropriately. Change 'Attribute' to 'Year' and 'Value' to 'Measurement'.

5
Filter out blank values

Click the filter dropdown arrow on the 'Measurement' column. Uncheck 'null' or empty boxes in the list to remove blank intersections from your final table.

6
Load the normalized table

Click 'Close & Load' in the Home tab to output the cleaned, flattened table back into a new Excel worksheet.

Use Power Query to Unpivot the Matrix
Dynamic Updates: If you add new rows or columns to your original matrix, you can simply right-click your new normalized table and select 'Refresh' to update the data automatically.
Free Microsoft Office alternative

A Fast, Free Alternative to Microsoft Office

Dealing with complex Excel matrices or heavy software subscriptions? WPS Office offers a free, lightweight, and highly compatible alternative. Enjoy a familiar interface and seamless handling of your existing .xlsx files without the hefty price tag.

  1. 1. Download and Install: Visit the official WPS website to download the free suite and complete the lightweight installation in minutes.
  2. 2. Open Your Files: Launch WPS Spreadsheet and open your existing Excel workbooks seamlessly without any formatting loss.
  3. 3. Process Data Effortlessly: Use familiar formulas, pivot tables, and data tools to manipulate and analyze your datasets completely free of charge.
100% compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Lightweight installation ensures fast performance even with large datasetsFamiliar user interface requires zero learning curveBuilt-in advanced formulas for complex data analysis
microsoft office alternative - wps office

Frequently Asked Questions

What is an Excel matrix and why should I normalize it?

An Excel matrix is a 2D grid where data points are mapped at the intersection of row and column headers. Normalizing it converts the grid into a flat, 1D tabular list (one record per row). This is essential for building PivotTables, charts, or exporting data to a database.

Can I unpivot a matrix without Power Query?

Yes, you can unpivot data without Power Query by using advanced dynamic array formulas in newer Excel versions (like TOCOL and REDUCE), writing a VBA macro, or using the legacy PivotTable and PivotChart Wizard (accessible via Alt+D, P) to create a multiple consolidation range.

Why are there blank values after unpivoting my data?

Blank values occur because Power Query unpivots every cell in the selected range, including the empty intersections in your original matrix. You can easily remove them by clicking the filter dropdown on your new values column and unchecking the 'null' option.

Will my normalized table update automatically if the original matrix changes?

If you used Power Query, the normalized table will not update instantly, but you can update it by right-clicking the output table and selecting 'Refresh'. If you used dynamic array formulas, the output will update automatically in real-time.