Can't Sort Imported Data

by Allen Wyatt
(last updated June 9, 2014)

12

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 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 not, 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 you situation.

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

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

Using AutoCorrect to Start Macros

As you are typing, AutoCorrect provides a "check" that what you are entering doesn't match some pre-defined error triggers. ...

Discover More

Changing Your Windows 7 Password

Want to change the password you use when you log into Windows? It's easy to do, as you discover in this tip.

Discover More

Appending to a Non-Document Text File

Your macros can easily add information to the end of an existing text file. This is done by opening the target file in Append ...

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 (ribbon)

Separating Cells Based on Text Color

If the font color used for the data in your worksheet is critical, you may at sometime want to move cells that use a ...

Discover More

Non-standard Sorting

Information in a cell can be entered using line feeds, which results in multiple lines of data in the same cell. If you later ...

Discover More

Sorting an Entire List

Need to sort all the data in a table? Here's the fastest and easiest way to do it.

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. 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 3 + 8?

2017-11-05 01:34:18

anilsharaf

excellent!!!!


2016-05-22 15:47:21

Kristen Clarke

Excellent tip. I thought I would have to export the data and start again.
No other help came near this simple tip.


2016-04-18 16:53:23

Carolyn Marshall

I don't have a Design tab. I'm Excel 2010.

I have a title Row and Print Area.

Clicked in the print area. That should be the data table.

Make a new document, type in junk and it does work.

Copy my table and edit/values and then it doesn't work.

Please help!


2016-04-06 09:29:53

KannyKen

Excellent tip. Sorted my problem in minutes! (Not sure I understood what I was doing but your instructions were clear!)

I had imported a simple document from LibreOffice spread sheet and could not sort the data. I had worried that in paying real money for real software after years of using freebies I had createsd a real problem. Seems like poetic justice that your free advice fixed it.


2015-10-08 15:09:37

Dave B.

Timesaver! Thanks!


2015-09-04 14:49:08

Kurt Finnegan

For me, the solution was to highlight everything and to Page Layout (At the top bar) and BREAKs, then remove Page Breaks.


2015-05-31 01:26:36

Another Rookie

Thanks so much! I must have a different version, but your advice was enough for me to figure it out. And yes, I was crying, it's late and it's past my bedtime.


2015-03-05 22:57:46

Rescued

In seconds, I solved a problem I had been tussling with for HOURS! No other information searches were successful. Then I found this. If there had been anyone else left at work, they'd have had me hauled away. I was cursing a blue streak.

THANK YOU THANK YOU THANK YOU! So easy when you know how!


2015-02-24 18:08:30

Dave

Step 2 above "Select the Design tab of the ribbon." Design tab doesn't show up and yes I clicked into the data area. A picture would help.

Thanks


2015-02-24 11:16:46

Meredith Roberts

Thank you for keeping me from crying at work.


2015-02-12 10:44:41

ExcelRookie

Thanks. Solved my problem in less than a minute!!


2014-11-19 11:53:16

Zoltan Gabanyi

I have a problem with sorting in Excel 10. I mada a small table (3 rows by 3 columns), and I filled it in with numbers. Then I made another column by summing up data in the first three columns. Then I tried to sort data using the calculated fourth column. Unfortunately, sorting is not done properly, numbers are not in descending order. What shall I do?


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.