Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Filtering Columns.

Filtering Columns

by Allen Wyatt
(last updated November 9, 2013)

3

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 choosing Edit | 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 (7453) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Filtering Columns.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Returning a Weight and a Date

If you have two columns containing dates and weights from those dates, you may want to pick a date associated with a given ...

Discover More

Using Named Ranges in a Macro

Named ranges are a great capability provided by Excel. You can define all sorts of named ranges in a workbook, but how do you ...

Discover More

Limiting which File Types You See in Drive

Overwhelmed with the number of files displayed on your screen when using Drive? Here's a handy way you can limit what is ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Recalculating when Filtering

Filter a large worksheet, and Excel will helpfully recalculate every time you apply a different filter. This can get ...

Discover More

Filtering for Comments

Excel makes it easy to filter a data table based on various values in that table. It isn't so easy to filter according to ...

Discover More

Counting Filtered Rows

The filtering capabilities of Excel are indispensable when working with large sets of data. When you create a filtered list, ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 + 4?

2016-08-16 23:03:05

Ron K

You really don't want to transpose the data because it is then hardcoded - if any of the data changes then you are out of sync.

You can create a range name of the original table of R Rows and C Columns

Then on another tab create a table of C Rows and R Columns and for each cell use INDEX(TableRange,C,R) [where R = 1 to C and C = 1 to R] and you will have a dynamic replica of the transposed table.


2016-05-18 03:04:58

Ravi Shankar Sharma

Horizontal Filter


2016-03-05 21:26:33

psg

A technique I use quite a bit is to use the advanced filter just to reorder and choose the columns. That is, ignore the criteria, just create an extract range with the columns you want in the order you want. With judicious table usage/naming, the execution becomes very simple or a one line macro.

The irony here is that this was the basic "filtering" in 1-2-3 (circa 1983) which is now the advanced filter in Excel.

Perhaps you can expand on this and create a new tip.


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.