Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

excel 2010/2013 insert rows is very slow

I am finding inserting rows in table structures or in normal cells - manually or otherwise - very very slow. Like it takes more than 10 mins to insert 7 rows in a table (containing literal strings only) or in adjacent cells, in a sheet with no conditional formatting.

The workbook has 45 worksheets and 20 tables, with the bigger tables having XML files of about 10KB. There are 33MB worth of spreadsheet XMLs with most being around 300KB with 5 more than 1MB and one being 15MB. Its fairly complex but not massive. All of the calculations flow nicely from left to right up to down, right sheet to left sheet and I've mostly managed to avoid array formulas. All of the tables have regular structures, with the calculated columns having one only formula. Most of the table columns are calculated, with only a couple of smaller ones containing literal data.

I do have a lot of conditional formatting on a couple of sheets but I've been very careful to keep it rational and stopped it from fragmenting: I have about 45 rules for the whole sheet and these are generalised to cover all columns. The main processing for the formating decisions are moved into the tables as helper columns and as I said, very regular in structure.

It seems that these type of edits are not thread safe so only one processor is loading up and there is very light disc activity. I can't understand what excel is doing all that time. Of course I set calculation to manual...

I've seen comments attributing this type of thing to the increased row and column limits, but I don't understand why this should be a factor. If I look at the XML files of the spreadsheets, there is only code for rows and columns that are occupied with values or formulas. So why are the unoccupied cells in play?

This is having a massive effect on my productivity - although I'm learning a lot by reading in sites like this in my new-found spare time. I really need to figure out what the problem is so that I can avoid or work around this issue if possible.

Can anybody help me on that?

Just in case people are wondering about this, the answer is to use power query and power view in excel. I find medium (500k lines) datasets and complex structures and transformations all work without a hitch. I never use formulae in tables anymore. The other thing is that this naturally leads you to power bi which is great. That's my tip.

like image 245
Cool Blue Avatar asked Oct 23 '13 14:10

Cool Blue


People also ask

Why does Excel take so long to add rows?

This issue occurs because of the defined names. There are over one million rows per column in Excel 2013. If you refer to the whole column, all rows of the column are loaded into memory when you perform an operation on the column.

How can I make a cell insert faster?

Press Ctrl + Shift + plus sign (+) at the top of the keyboard. Excel will insert the same number of rows you selected.

Why is Excel not inserting rows?

You have probably inadvertently entered something in the last row of the worksheet and hence you "can't insert new cells because it would push non-empty cells off the end of the worksheet". Select the entire row (click on the row number at the left). Hold both the Shift and Control keys.


2 Answers

Long insertion times may be due to INDEX (or other functions) that reference a whole column, or a whole row.

I had a very similar problem: not too complex worksheet (about 2500 rows, with 15 columns of data (results from a query), and about 10 columns of formulas to extract data from the query results. when I inserted a column, the first columns might insert within 4 seconds or so, but the second insert would take over a minute. Yikes! I searched the internet and found this site http://support.microsoft.com/kb/2755145.

My experience:

I was using a formula like =INDEX(11:11,1,MATCH(AC$5,$10:$10,0)), about 25000 times in my worksheet. You can see that each formula references an entire row twice. Apparently, when I added a column, since each row is affected, and therefore each of my formulas was affected, Excel would dutifully go to work trying to figure out what to do about that.

Based on what I learned form the microsoft website, I changed the formula to =INDEX(QueryResults,ROW()-ROW(QueryHeaders),MATCH(AC$5,QueryHeaders,0)), where the QueryResults and QueryHeaders are simple named ranges.

After I made this change throughout the sheet, inserting a column became almost instantaneous - less than a second.

like image 70
Chuck Trese Avatar answered Sep 25 '22 10:09

Chuck Trese


This sounds like the problem described here http://fastexcel.wordpress.com/2012/01/30/excel-2010-tableslistobject-slow-update-and-how-to-bypass/

If so you have to break one of the conditions to bypass it:
For this slowdown to occur each of the following conditions must be true:

A cell within the Table must be selected
The sheet containing the Table must be the Active Sheet
The cell being updated must be on the same sheet as the table, but does not have to be within the table
There must be a reasonable number of formulas in the workbook.


Maybe you could do the update indirectly via VBA with another sheet active. Or Maybe moveing all the formulas to a separate workbook would bypass it.
Or convert your Tables back to normal ranges (& use dynamic range names if neccessary)

like image 34
Charles Williams Avatar answered Sep 21 '22 10:09

Charles Williams