Can't Sort Imported Data

Written by Allen Wyatt (last updated November 7, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


Martin is importing data into a worksheet from an SQL view; it comes in perfectly. Excel automatically creates a defined table using the imported data. Martin then inserts new columns in the middle of the table so he can start to work with the data, but once these new columns are inserted, he cannot sort the worksheet—the option is grayed out. Martin is wondering why this is happening and how to fix it.

The problem is probably due to the fact that the data is being imported as a defined table. Defined tables can have some "peculiarities" (shall we say) that affect what you can and cannot do with them. You can figure out if this is what is causing the problem by following these steps:

  1. Make sure you select a cell within the data table.
  2. Select the Design tab (or Table Design tab) of the ribbon. (This tab is available only if you select a cell in your data table, as noted in step 1.)
  3. Click the Convert to Range tool in the Tools group. Excel asks you if you want to convert the table to a normal range.
  4. Click Yes.

That's it; if you can now add information and sort your data, then the problem is solved. If you cannot see a Design or Table Design tab in step 2 (and you selected a cell in the data table), then your data is not a defined table and these steps won't work. If the problem persists, then it could be because the SQL connection between the data source and Excel is somehow limiting what you can and cannot do with the data. You may need to poke around in the Trust Center settings for external content in order to figure out what will work with your situation.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9044) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

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

Changing How Footnote References Appear

Footnote references normally appear as superscripted digits, both in the main body of your document and in the footnotes ...

Discover More

Using Revision Tracking

Want to keep track of the changes other people make to your workbook or even your own changes? Excel makes gathering this ...

Discover More

Understanding the While...Wend Structure

Logical structures are important in programming, as they allow you to control how the programming statements are ...

Discover More

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!

More ExcelTips (ribbon)

Sorting with Graphics

If you use graphics in a worksheet that are associated with certain cells (perhaps images of parts or icons for worksheet ...

Discover More

Sorting while Ignoring Leading Characters

Want to ignore some characters at the beginning of each cell when sorting? The easiest way is to simply create other ...

Discover More

Sorting by the Last Digits in Variable Length Data

Excel is great at sorting information in a worksheet. Sometimes it can be a bit confusing as to how to set up the sort ...

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}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. 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 + 5?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

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.