Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a load of data in a csv file that I'm importing into Excel, most of it is fine, but one of my columns contains up to 1000 characters of data. Unfortunately, Excel has taken it upon itself to assume that's more data than I need and seems to be cutting it short (at 255 chars).

How can I increase this limit and retain all my data?

share|improve this question

migrated from stackoverflow.com Jan 28 '13 at 15:22

This question came from our site for professional and enthusiast programmers.

    
What do you mean by "Unfortunately, Excel has taken it upon itself to assume that's more data than I need and seems to be cutting it short." is it not displayed properly? what happens if you put =LEN(A1) into Excel where A! is the reference to your text? –  Peter Albert Jan 28 '13 at 13:15
    
It says 255, and when i look at the data In the formula entry box it just suddenly stops. I can display the full data in open office, but as soon as I paste to excel it seems to be limiting to 255 chars. The reason I am not using open office is because I can past as data or do a vlookup in that. –  WebweaverD Jan 28 '13 at 13:36
    
Excel can handle texts longer than 255 chars. However, if the cell is filled by VBA, it is a bit complicated. What's your source? How do you get it into Excel? –  Peter Albert Jan 28 '13 at 13:47
    
I have a csv export from magento. If I open in OO it has the full text. If I open in Excel its cut short. Also gets cut short when I paste from OO to excel and I cannot manually type any more in the cell, it just gets cut off at the same point as soon as I leave the cell. –  WebweaverD Jan 28 '13 at 14:12
    
Maybe something is off with the CSV? Can you update your question and post some lines? Also, maybe the delimiter and separator settings on your machine start acting up? –  Jan Doggen Jan 28 '13 at 16:07

3 Answers 3

There is a weird bug in Excel. I'll explain here how to avoid (not fix, just avoid) it, and maybe it will fixed soon by MS Office programmers. Maybe it even WAS fixed in Excel 2013, I did not open it yet.

So, this is the problem.

The maximum length of the text cell is 32767, and it's OK.

The maximum length of the number cell is 255, and it's OK.

But if you have a cell that calls to number parser, fails and then calls to text parser, here will be the big mess.

For example:

...,"This is a cell with 30,000 characters........",...

will work.

But if you'll put a little minus at the start, as in

...,"-This is a cell with 30,000 characters........",...

you'll see only 255 first text characters, because EXCEL thinks it's a negative number.

Hope it helps.

share|improve this answer
up vote 0 down vote accepted

Firstly, Thank you all for your help in trying to solve this. It turns out excel can quite happily accommodate more than 255 chars to a cell (presumable up to 32,767 as previously mentioned if you've got the ram for it.

So why didn't is work?

The short answer is I'm not sure. The first time I brought the data into excel I exported as a csv then opened in excel. This cut the columns short (at 255). (the csv file contained all the data when viewed through notepad but not when saved again through excel).

The column in question did contain some semicolons, but this didnt correspond to the cut off point (always 255) and I wasnt using ; as a delimiter.

My solution wast to do an export as an xls file. This has since been saved successfully as a csv file with the full data.

Hope this helps someone even though I'm still not sure exactly what the issue was here.

share|improve this answer
    
Simple Googling results in a lot of forum post of people who have the same problem; it's probably just a bug in the Excel CSV import routine. –  Marcus Chan Jan 28 '13 at 16:41

According to http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP010342495.aspx, Excel 2010 only supports a 255 character column width.

Edit: Is this the problem you're talking about, Webweaver? Does Format > Cells > Wrap Text make the rest of the characters visible?

Edit: Never mind, this answer is somewhat unrelated to the problem at hand (possibly related somehow, but it doesn't answer the question)

share|improve this answer
    
No, that's the COLUMN WIDTH. From the same table, the "Total number of characters that a cell can contain" is 32,767 characters. –  Vicky Jan 28 '13 at 15:35
    
@Vicky, isn't that the problem the asker is experiencing? Or did I misinterpret the question? –  Marcus Chan Jan 28 '13 at 15:51
    
@nixda real? yes real annoying. I cant believe excel cannot handle more the 255 chars. There is a way to do this! –  WebweaverD Jan 28 '13 at 16:01
    
@Marcus I dont understand what it means by column width. This isn't just a display issue the data isn't there. It gets cut short. when I save as a csv the data isn't there. when i do len(cell) the result is 255. –  WebweaverD Jan 28 '13 at 16:04
    
@MarcusChan, the number of characters should be limited to 32767. The user is experiencing it being limited to 255. What you were referring to was the column width which is to do with how the column is displayed, which is not the OP's problem. –  Vicky Jan 28 '13 at 16:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.