Excel: column width

At work we’re setting column widths in Excel. For example, the phone number field is set to 12. I’m told that’s 12 characters. So I’m looking at phone numbers, and they’re 14 characters including parentheses, spaces and dashes. Even though the column width is set to 12, all 14 characters are visible. Extensions add another 10 characters. These are not visible, but they’re still there. (BTW we’re using 10 pt. Arial.)

Now, I come from a mainframe background. If I write a program and define a field as 12 bytes, then it’s 12 bytes. You can’t put any more in there. So what’s going on with Excel? When I put 12 in column width, is that how many characters of a given font and size will be visible? (And which font?) If I print it out, will that be the number of characters that will print? When the file is FTP’d to a mainframe, is the entire field uploaded regardless of the column width?

You have two concepts going here:

  1. The number of all characters in the largest cell of that column can be called the max field width.

  2. The display of that column is just the way that Excel chooses to display things and isn’t that important for data purposes. For instance, part of my job is blowing data from a giant Oracle database into Excel. I use a tool to do the end writing to a spreadsheet. I might have 8 extra characters to a field but Excel doesn’t render than it a pretty way when you first open it. I might set that field to a field length of 30 to good it to look OK. However, 8 positions would have been fine if it is supposed to be machine readable or a person wants to take two seconds to revise the column on a regular basis.

First, Excel is in some ways more of a layout program than a data program. The column width is used to fix the “physical” width of the column for display purposes. You’ll note that you can set it to fractional values (mine defaulted to “8.43” when I checked just now), which is kind of a clue.

As to what the units actually are… I have no idea.

Second, the width limitation just controls how wide the display will be, it has no effect on the data at all, as you can see.

From: How column widths are determined in Excel - Microsoft 365 Apps | Microsoft Learn

You’ve come close to your answer when you stated that your characters are 10 pt. Arial. That means you realize that the amount of type that will fit in that column depends on the font and size. You realize that some fonts and sizes take up more space than others, and in most fonts each character has its own width. E.g. a cap “W” will take up more space than a lowercase “i”. So you can’t really count characters that way, like you probably could in mainframe. I don’t know what unit of width is used in Excel, but the width of the column is absolute, regardless of font and size and the particular characters involved (unless you go to AutoFit).

That’s what I thought. I told my boss that since more or fewer than the ‘coumn width number of characters’ can be displayed by changing the font size, I didn’t think that the column width meant ‘fixed width field’. I said that since they’d been sending the data to be uploaded in the same format for a long time, and since they always defined column widths, and since the people who get the data have no problem seeing all of the characters even though there are more characters than ‘column width’, then I didn’t think the fields werre truncated. She’d been operating under the assumption that fixing the column width did limit the number of characters of data.

A number “8” or a lowercase “o” seem to be average width characters. The cell in the OP will fit exactly 12 of either of those when the width is 12.

I often get excel documents where much of the data is not visible in the field. I simply readjust the column widths so I can see everything and resave it. Perhaps the people who get the data have been doing the same thing.

I hope that she is nice to work for, 'cause she does not sound like she has a clue what she’s doing in this regard.