How to Filter Data Horizontally by Row in Excel
Question details
The user wants to filter a dataset horizontally across columns based on specific row criteria.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Managing and analyzing horizontal datasets where information is spread across multiple columns instead of standard vertical rows.
- Observed behavior
- Excel's built-in AutoFilter feature only works vertically by column and cannot hide columns horizontally to filter by row.
Review your dataset layout to see if it can be permanently restructured into a vertical format, as this is the most effective way to utilize standard spreadsheet filtering tools.
Transpose Horizontal Data to Vertical
Convert your horizontal dataset into a standard vertical format to seamlessly use Excel's built-in AutoFilter feature.
Since standard filtering only works vertically, transposing your data flips the rows and columns. This turns your horizontal records into standard vertical records that can be easily filtered.
Highlight the entire horizontal dataset you want to filter and press Ctrl+C (or right-click and select Copy).
Right-click on a new, empty cell where you want the transposed data to start. Select 'Paste Special', check the 'Transpose' box at the bottom of the dialog, and click OK.
Select the newly created column headers. Go to the 'Data' tab on the Excel ribbon and click the 'Filter' button to begin filtering your data vertically.

Use the FILTER Function (Microsoft 365)
If you are using Microsoft 365 or Excel 2021, you can use the dynamic array FILTER function to extract horizontal data matching specific criteria without altering the original table.
Use a VBA Script to Hide Columns
Use a VBA macro to iterate through rows and automatically hide columns that do not match your desired filter criteria.
Easily Transpose and Filter Data in WPS Spreadsheet
WPS Spreadsheet provides intuitive tools to seamlessly transpose your horizontal data into standard vertical tables, allowing you to apply powerful data filters in just a few clicks.
- 1. Select and Copy: Highlight your horizontal dataset in WPS Spreadsheet and press Ctrl+C.
- 2. Paste Special Transpose: Right-click an empty destination cell, choose 'Paste Special', check the 'Transpose' option, and confirm.
- 3. Apply Filter: Select the new header row, navigate to the 'Data' tab, and click 'AutoFilter' to filter your data vertically.

Frequently Asked Questions
Why doesn't the standard Excel AutoFilter work horizontally?
Excel's database structure is designed to treat columns as distinct fields and rows as individual records. Therefore, built-in features like AutoFilter, Advanced Filter, and PivotTables are optimized exclusively for vertical data organization.
Can I use the Advanced Filter tool to filter data by row?
No, the Advanced Filter tool in Excel also works exclusively on vertical data columns. To filter data horizontally, you must rely on functions like FILTER, use a VBA script, or transpose the data first.
Is the FILTER function available in older versions of Excel?
The dynamic array FILTER function is only available in Microsoft 365, Excel 2021, and newer versions. Users on older versions like Excel 2016 or 2019 will need to transpose the data, use complex INDEX/MATCH array formulas, or utilize VBA to achieve horizontal filtering.




