Can't Sort Imported Data

by Allen Wyatt
(last updated September 29, 2020)

15

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 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 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 Office 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 Colors of Spelling and Grammar Underlines

The red and green wavy underlines used in Word can be a boon for proofing a document, but they are of little use if you ...

Discover More

Running Out of Memory

Do you get an error when you try to insert just one more chart in your workbook? It could be because of an obscure ...

Discover More

Removing Shortcuts for Macros

Word apparently has a bug in it that makes it very difficult to remove a shortcut key previously associated with a macro. ...

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)

Sorting for a Walking Tour

Want to sort addresses by even and odd numbers? By using a formula and doing a little sorting, Excel can return the ...

Discover More

Too Many Formats when Sorting

Sorting is one of the basic operations done in a worksheet. If your sorting won't work and you instead get an error ...

Discover More

Incomplete and Corrupt Sorting

Using the sorting tools, on the toolbar, may result in some unwanted results, such as jumbled data. If this happens to ...

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 less than 8?

2020-07-08 20:43:14

Ryan K

Using the Get & Transform GUI, can I import the data as a Range instead of as a Table? I ask because I often work with very large datasets that I need to be able to sort, but converting from a Table to a Range takes an astronomically long time to process with big data. Is there some other quick workaround?

Thank you!


2020-04-21 17:02:48

Peter Atherton

Hi Lisa
If you are importing data tou should think of using Power Query. Power Query is on the Data Tab. Excel 2016 has this installed, you can see it In the Data Tab --> Get abd Transform group.
You can still download the addin for Excel 2010 & 2013 this link shows how
https://www.myexcelonline.com/blog/installing-power-query-excel-2010/
There are already fine tutorials on Power Query on line with screen grabs and instructions. Power Query is designed for people that regularly import data and allows you to fix and sort the data before you paste it into Excel. Years ago, scientists working with genes would complain when Excel converted the SEP19 gene into a date; you can fix the type of each column and change it when necessary. I'd try the following link
https://exceljet.net/glossary/power-query
This returns the latest figures of covid-19 cases and deaths for each state in America.
Another good link that shows you how to list all your files on the computer is:
https://exceloffthegrid.com/power-query-file-attributes/
To list the files before required a Macro and this is just a few steps.

HTH


2020-04-20 23:24:29

Lisa

HI, you completely lost me. Can you provide us some visuals, please? Otherwise, I don't really think there's much point for novices who have no idea what you're referring to in regards to "Design Tab" unless your tips are strictly for Advanced users. If this is the case, I would like to see a disclaimer so novices don't have to waste our time and increase or stress levels.

For example you wrote:

Make sure you select a cell within the data table.
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.)
Click the Convert to Range tool in the Tools group. Excel asks you if you want to convert the table to a normal range.
Click Yes."


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.