How to Autofit Data in Excel: Columns and Rows Guide
In this article
To autofit data in Excel, double-click the boundary line on the right side of the column header (the lettered bar) or the bottom boundary of the row header (the numbered bar). This instantly adjusts the width or height to fit the longest piece of content in that specific selection. This process eliminates the "#######" error seen when numbers are too wide for a cell and removes unsightly white space when columns are unnecessarily large.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS) or access to Excel for the Web.
- An active workbook containing data that is either truncated (cut off) or has excessive empty space.
- A mouse or trackpad for precise clicking on column and row boundaries.
Step-by-Step
- Select the Target Column: Move your cursor to the top of the spreadsheet where the column letters (A, B, C, etc.) are located. Hover your mouse over the vertical line that separates the column you want to resize from the one to its right. For example, if you want to autofit Column A, hover over the line between A and B. Note that labels and menu locations may differ slightly depending on your version of Excel or your operating system.
- Execute the Double-Click: Once your cursor transforms into a double-headed arrow (pointing left and right), double-click the left mouse button. Excel will immediately scan all cells in that column and expand or shrink the width to perfectly fit the longest string of text or the largest number.
- Autofit Multiple Columns Simultaneously: If you have a large dataset, resizing one by one is inefficient. Click and drag across the column headers (e.g., click A and drag to E) to highlight multiple columns. Alternatively, click the "Select All" button (the small triangle in the top-left corner where the row numbers and column letters meet).
- Apply Bulk Autofit: While multiple columns are highlighted, double-click any single boundary line between any of the selected column headers. Every selected column will independently adjust to its own optimal width based on its own specific content.
- Autofit Row Height: The process for rows is identical but vertical. Move your cursor to the row numbers on the far left. Hover over the boundary line below the row number you wish to adjust until the cursor becomes a double-headed arrow pointing up and down. Double-click to snap the row height to the tallest piece of data in that row.
- Using the Ribbon Menu: If you prefer using the interface over mouse shortcuts, select the cells or columns you wish to fix. Navigate to the Home tab on the top ribbon. In the Cells group, click the Format button. From the dropdown menu, select AutoFit Column Width or AutoFit Row Height.
Common Mistakes
One of the most frequent errors users make is trying to autofit while a cell is in "Edit Mode." If you have double-clicked inside a cell to change text or are typing in the formula bar, the column boundary double-click will not work. You must press Enter or Esc to exit the cell before the autofit command becomes active.
Another common mistake is confusing "AutoFit" with "Wrap Text." AutoFit changes the physical dimensions of the column to fit the text on one line. Wrap Text keeps the column width the same but increases the row height to stack the text vertically. If you autofit a column that has Wrap Text enabled, Excel may not expand the width as much as you expect because it assumes you want the text to wrap rather than stretch the column across the screen.
Users also frequently forget that hidden columns are ignored during a "Select All" autofit. If you have hidden columns (e.g., Column B is hidden between A and C), selecting the whole sheet and double-clicking will autofit the visible columns, but the hidden ones will remain hidden and their widths will not be updated until they are unhidden.
Tips
For professional-looking reports, avoid autofitting columns that contain extremely long paragraphs of text. If one cell contains a 200-word description, AutoFit will create a column so wide that you will have to scroll horizontally for a long time to see the rest of your data. In these cases, it is better to manually set a reasonable width and use the Wrap Text feature found in the Home tab.
If you are preparing a sheet for printing, use the Page Layout view. This allows you to see exactly how the autofitted columns fit onto a physical page. If AutoFit makes your table too wide for a single sheet of paper, you can use the Scale to Fit options in the Page Layout tab to shrink the entire dataset to fit the printable area without manually resizing every column again.
Keyboard shortcuts can speed up the process for power users. While there isn't a single key for "AutoFit," you can use the Alt sequence. Press Alt, then H (Home), then O (Format), then I (AutoFit Column Width). Practicing this sequence allows you to resize columns without ever touching the mouse.
Troubleshooting
The "#######" symbols won't go away: This usually happens because the column is too narrow to display a number or a date. If double-clicking the boundary doesn't work, check if the cell is formatted as a Date or Currency with a very long string. Ensure you aren't in Edit Mode. If the problem persists, try manually dragging the column wider to see if the value appears, then try the AutoFit command again.
AutoFit is making columns too wide: This occurs when there is a single cell with an unusually long entry (like a URL or a long note) that you didn't notice. To fix this, find the outlier cell, either truncate the text, move it to a different area, or use Wrap Text on that specific cell. Once the outlier is handled, re-apply the AutoFit command to bring the column back to a manageable size.
The double-click isn't triggering: Ensure your cursor is exactly on the line between the headers, not inside the header itself. The cursor must change from a white cross or a pointer to a black double-headed arrow. If it doesn't change, you are not positioned correctly on the boundary line.
Row height won't adjust: If you have manually set a specific row height previously, some versions of Excel may prioritize that manual setting. Try selecting the row, going to Home > Format > AutoFit Row Height to override any manual constraints.
Frequently Asked Questions
Does autofitting data delete any content?
No. AutoFit only changes the visual width of the column or the height of the row. It does not alter, delete, or truncate the actual data stored within the cells.
Can I autofit an entire worksheet at once?
Yes. Click the Select All button (the triangle in the top-left corner of the grid) and then double-click any column boundary to autofit every column in the workbook simultaneously.
Why does my column still look too small after autofitting?
This often happens if you have merged cells. AutoFit does not work reliably with merged cells because Excel cannot determine which column the content "belongs" to. You may need to resize merged cells manually.
Is there a difference between AutoFit and manual resizing?
Manual resizing involves clicking and dragging the boundary to a specific spot. AutoFit is an automated calculation that sets the width based on the longest character string in the column.
Does AutoFit work in Excel for the Web?
Yes, the double-click boundary method and the Format menu options work in the web-based version of Excel similarly to the desktop application.
Will AutoFit change my font size?
No, AutoFit only changes the cell dimensions. If you want the text to shrink to fit the cell without changing the column width, you must use the "Shrink to fit" option found in the Format Cells alignment settings.