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

Viewing More of the Left Margin Area

When working in Draft or Normal view, you may want to view the area just to the left of the document's left margin. ...

Discover More

Moving the Insertion Point to the Beginning of a Line

If you need to move the insertion point within your macro, then you'll want to note the HomeKey method, described in this ...

Discover More

Entering a Page Break from the Keyboard

Need to force Word to move text to the top of the next page? It's easy when you use the keyboard shortcut for a page break.

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Taking Bold Text into Account in a Sort

If you have some data in a worksheet that is bold, you may want to sort that data based on the text attribute. This is ...

Discover More

Sorting Dates by Month

Sorting by dates is easy, and you end up with a list that is in chronological order. However, things become a bit more ...

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
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 nine more than 6?

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.