How to AutoFit column width in Excel
Resize columns to fit their contents so nothing is cut off and numbers do not turn into hash marks.
Excel cuts text off at the edge of a cell when the cell next door is occupied, and it turns numbers into hash marks when they do not fit. Neither problem needs the data to change; the column only needs to be wider.
AutoFit measures the longest entry in a column and sets the width to match. It is the fastest way to make a table readable.
Steps in Excel for Windows
- Select the columns. Click the column letter to select one column, drag across letters for several, or click the square at the top-left corner of the grid to select the whole sheet.
- Double-click a column border. Move the pointer to the right edge of any selected column header until it turns into a double arrow, then double-click. Every selected column resizes to fit its widest entry.
- Or use the ribbon. On the Home tab, in the Cells group, choose Format, then AutoFit Column Width. The keyboard route is Alt, H, O, I.
- AutoFit rows the same way. Double-click a row border, or choose Format, AutoFit Row Height, Alt, H, O, A. Use it after turning on Wrap Text.
- Set an exact width when asked. Format, Column Width lets you type a number. The default is 8.43 characters. Drag the border for a rough setting.
Worked example
1. Hash marks fixed by AutoFit
| A | B | |
|---|---|---|
| 1 | Region | Revenue |
| 2 | East | ##### |
| 3 | West | ##### |
| A | B | |
|---|---|---|
| 1 | Region | Revenue |
| 2 | East | 1,234,567,890 |
| 3 | West | 987,654,321 |
Column B holds revenue formatted with thousands separators. At the default width the values do not fit, so the cells show #####. After AutoFit, column B is as wide as its longest value and the numbers appear in full. The numbers never changed.
2. How wide the formatted number is
| A | B | C | |
|---|---|---|---|
| 1 | Region | Revenue | |
| 2 | East | 1234567890 | 13 |
TEXT formats B2 with thousands separators and LEN counts the characters. 1,234,567,890 is 13 characters, and a default column holds about 8, which is why the display switched to hash marks.
Common mistakes
- AutoFit sized by the header. A long title in the header row makes the whole column wide. Wrap the header text or shorten it, then AutoFit again.
- Merged cells ignored. AutoFit does not size a column for text in a merged cell. Widen those columns by hand.
- Expecting it to follow later changes. AutoFit is a one-time resize. If you type longer entries afterward, run it again. Columns never resize on their own.
- Shrinking a number to cure the marks. Changing the value or rounding it away is wrong. The value is fine. Widen the column instead, or apply a shorter number format if the task allows.
- Wrapped text that grows the row. A cell with Wrap Text set grows taller, not wider. Use AutoFit Row Height to fit it.
On Excel job tests
A plain instruction such as "make all the data readable" or "widen the columns so everything is visible" is an AutoFit task. Select the whole sheet with the corner square first and double-click one border so every column is handled at once.
If a prompt shows ##### in a cell, widening the column is the fix. Rewriting the value or the number format changes the data, so leave them alone unless the prompt asks.
Related guides
Questions
- What is the shortcut for AutoFit column width?
- On Windows, press Alt, H, O, I with the columns selected. Double-clicking the column border does the same.
- How do I AutoFit every column at once?
- Click the square at the top-left corner to select the sheet (or press Ctrl+A: the first press selects the data region, so a second press selects the sheet in a plain range, and a third is needed inside an Excel Table), then double-click the border between any two column letters.
- Why does AutoFit not shrink my column?
- A cell in that column still holds something wide, such as a long title or a stray entry far down the sheet. AutoFit fits the widest cell in the column.
- What is the default column width?
- 8.43 characters, about 64 pixels, in a new workbook with the standard font.
Practice this
The free lesson Column width and wrapping has checked exercises for this skill in a working grid.
Practice this skill