Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Filtering Columns.
by Allen Wyatt
(last updated February 2, 2017)
Mayur knows that he can use Excel's filtering capabilities to select which rows in a data table are displayed, but wonders if there is a way to filter by column. In other words, he can now filter vertically, but he would like to filter his data horizontally.
The short answer is that there isn't a way. Excel, when used to store data, follows a database paradigm that equates rows with records and columns with fields in each record. Classical filtering is done by examining values in columns (fields) and thereby determining which rows (records) should be displayed based on what is found there.
The easiest way to filter your data the way you want is to transpose it before filtering. Copy all your data (select it and press Ctrl+C), and then on a different worksheet use the Transpose option of Paste Special. You can display this dialog box by starting at the Home tab of the ribbon, clicking the down-arrow under the Paste tool, and then choosing Paste Special.
Once your data is transposed (rows become columns and columns become rows), you can then use Excel's built-in filtering tools as you normally would.
If you prefer to not transpose your data, you will need to resort to less automatic solutions. For instance, you could manually figure out which columns you want to hide ("filter out") and then actually hide those columns. When you are done hiding all the columns you want hidden, you could define a custom view (as described in other ExcelTips) to save how the worksheet appears.
Finally, you could always create a PivotTable from your data. You can then, in the PivotTable, use the filtering tools to determine what data is shown in the table. The tools there will work on both row fields and column fields.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12918) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Filtering Columns.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
When you use Excel to input and store information, you need to be concerned with whether the information meets your ...Discover More
When working with filtered data, you may want to specially format a column that has a filter applied to it. Here are a couple ...Discover More
Filtering can be a powerful way to work with large amounts of data in a worksheet. If you use filtering quite a bit, you may ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.