Can't Sort Imported Data

by Allen Wyatt
(last updated March 16, 2018)

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

Periodically Delete TMP Files

After using Word for a while, you may notice some "litter" of unused files on your hard drive. This tip explains how ...

Discover More

Hiding and Protecting Columns

Want to hide certain columns within a worksheet so the contents are not visible to others? The answer lies in formatting ...

Discover More

Replacing with a Subscript

The Find and Replace capabilities of Word are quite powerful. One type of replacing may not seem possible at ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Fixing Odd Sorting Behavior

When you sort data that contains both numbers and text, you may not get exactly the result that you expected. To know ...

Discover More

Moving Cell Borders when Sorting

Sort your data and you may be surprised at what Excel does to your formatting. (Some formatting may be moved in the sort ...

Discover More

Forcing Excel to Sort Cells as Text

If you have a mixture of numbers and text in a column and you want to sort based upon that column, the results may not be ...

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

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.