If Excel AutoFit is not working, select the affected columns or rows and choose Home > Format > AutoFit Column Width or AutoFit Row Height. If the result is still wrong, check for merged cells, wrapped text, hidden rows or columns, worksheet protection, and content that AutoFit cannot measure as expected.
How AutoFit works in Excel
AutoFit adjusts a column’s width or a row’s height to fit the displayed contents of its cells. It is a sizing command, not a setting that keeps the sheet automatically resized after every later edit. For example, if you AutoFit a column and then type a longer entry, Excel may not resize it again; run AutoFit another time if needed.
Column width is based on the contents Excel can see in the selected column and the workbook’s font settings. Row height depends on the displayed content and, in particular, how many lines need to fit. With Wrap Text on, a narrow column can make a cell display on several lines, so AutoFit Row Height may increase the row’s height. Without wrapping, long text may appear to spill into adjacent empty cells rather than make the row taller.
AutoFit works on ordinary cell contents, including text, numbers, dates, and formula results. It does not resize cells to fit pictures, charts, or other floating objects. Excel also has maximum row-height and column-width limits, so exceptionally large content cannot always be displayed in full by resizing.
Run AutoFit with the ribbon or mouse
In Excel for Microsoft 365 on Windows, use these steps to fit a column:
- Select the column or the cells in the column that you want to adjust.
- Go to Home > Format > AutoFit Column Width.
To fit a row’s height, select the row or relevant cells and choose Home > Format > AutoFit Row Height. You can also select multiple adjacent rows or columns before using the command. To select a whole column or row, click its letter or number heading. To select several nonadjacent columns, hold Ctrl while clicking their headings.
The mouse method is often quickest: point at the boundary between two column letters, such as the line between A and B, and double-click when the pointer changes to the column-resize cursor. Excel fits the column to its contents. Double-click the boundary below a row number to fit that row’s height. If you select several columns or rows first, double-clicking a boundary in the selection can fit the selected set.
On Windows, the ribbon KeyTips also provide keyboard access: press Alt, then H, O, I for AutoFit Column Width, or Alt, then H, O, A for AutoFit Row Height. These are sequential ribbon keys, not a combination pressed all at once. On a Mac, keyboard shortcuts and KeyTips differ; use the Home tab’s Format menu and choose the corresponding AutoFit command. Excel for the web also offers AutoFit through Home > Format, though the available interface can vary with the browser window and current selection.
Check merged cells first
Merged cells are one of the most common reasons AutoFit seems broken. Excel does not reliably AutoFit a row or column based on text in a merged range. The text may be visibly clipped or wrap into several lines while the row remains too short, and repeating AutoFit may not change it.
If the merged layout is not essential, select the range and use Home > Merge & Center > Unmerge Cells. Then apply Wrap Text if appropriate and run AutoFit Row Height. If the merged appearance is required, resize the row or column manually by dragging its boundary, or enter a specific size through Home > Format > Row Height or Column Width. Another option is to place the text in an unmerged cell and use alignment or borders to achieve a similar layout.
A merged heading spanning several columns is not a reliable basis for fitting each column individually: Excel cannot simply divide the heading’s length into an ideal width for every column. For a report, it is usually better to keep the heading in one unmerged cell or adjust the layout by hand after fitting the data columns.
Wrapped text and row height problems
If a cell contains several lines but the row is not tall enough, first select the cell and check Home > Wrap Text. Then select the affected row and choose Home > Format > AutoFit Row Height. A manual row height can prevent the row from expanding as expected, so AutoFit is useful when you want Excel to calculate a fresh height.
Line breaks inserted inside a cell can also affect the result. A line break may have been entered with Alt+Enter on Windows or Control+Option+Return on a Mac, or brought in when data was pasted. If the cell has several intended lines, wrapping and a suitable row height are needed to show them all. If a row still appears clipped, check whether the text is merged, whether the font size is unusually large, and whether the row has been constrained by a fixed height.
Another possibility is that the content is not actually in the row you are adjusting. A tall-looking block may contain text in a neighboring row, or a shape may be covering the cells. Select the cell and inspect the formula bar to confirm its contents; then verify that the correct row heading is selected before running AutoFit.
Content and formatting that change the result
AutoFit responds to what Excel displays, not always to what a person expects the underlying value to look like. A date stored as a number, for instance, may display as a short date because of its number format. A formula cell is sized for the formula’s result, not the formula text. If a formula returns a long message, the displayed message can affect width or height; if it returns a short number, the formula’s long expression does not.
Check these details when the fitted size seems unexpectedly small or large:
- Number formats: A custom format can add displayed symbols or hide parts of a value. Inspect the cell’s number format if its appearance seems inconsistent with its stored value.
- Whitespace: Leading or trailing spaces and nonbreaking spaces copied from a website can make text wider than it looks. Edit the cell or clean the source data if those characters are unwanted.
- Font settings: A large font or a different font can require more room. AutoFit uses the cell’s formatting, so changing the font may change the fitted size.
- Long entries: A long URL, identifier, or unbroken string may cause a column to become very wide. Wrapping, a narrower manual width, or a shortened display label may be more useful than AutoFit.
For example, if column C contains a long web address, AutoFit may expand the whole column to accommodate it. If the goal is a compact worksheet, set a reasonable width and turn on Wrap Text, or display a short label instead of the complete address. AutoFit aims to fit content; it does not know which layout is easiest to read.
Selection, hidden cells, and worksheet restrictions
Confirm that the intended rows or columns are selected. AutoFit applied to a selection affects that selection; it will not necessarily fix other parts of the sheet that look similar. Selecting a range of cells rather than the column headings can also produce a result that differs from fitting the entire column, particularly when other cells in that column contain longer entries.
Hidden rows and columns can make the result confusing because their content is not visible in the grid. Unhide the relevant headings temporarily, check the cells that contain the longest values, and then run AutoFit on the full columns or rows as needed. Filters can hide data rows, so if the visible results do not explain a width or height, clear or adjust the filter and inspect the underlying data.
Worksheet protection is another practical obstacle. A protected sheet may prevent column-width or row-height changes unless formatting permissions allow them. Check Review > Protect Sheet and, if you have permission, unprotect the sheet or change its protection settings before resizing. If the workbook is shared or controlled by someone else, ask its owner rather than trying to bypass the restriction.
Choose a better sizing method when AutoFit is not ideal
AutoFit is useful for getting a quick size based on current data, but a consistent manual width can be better for a polished worksheet. For example, a data-entry sheet with many rows may be easier to scan when all date columns have the same width, even if some cells could be narrower. Use Home > Format > Column Width or Row Height to enter a specific size, or drag a row or column boundary to adjust it visually.
For long descriptions, set a practical column width and turn on Wrap Text, then fit the row heights. For headings that should stay on one line, consider a shorter heading or a wider column. Shrink to Fit, available in the Format Cells alignment options, can reduce text size to fit a cell, but it may make the text hard to read and does not solve every row-height issue. Avoid using it as a substitute for a readable layout.
After adding or importing data, run AutoFit again if new entries are longer than the existing ones. If you frequently add data to a formatted Excel table, remember that table formatting does not mean every column will continually AutoFit as new values arrive. Review widths after adding content, or choose stable widths and wrapping rules that work for the expected range of entries.
Frequently Asked Questions
Why does Excel AutoFit not work on merged cells?
AutoFit does not reliably calculate the needed size for merged ranges. Unmerge the cells and fit them, or set the row height and column width manually if the merged layout must remain.
How do I AutoFit all columns in Excel?
Click the Select All button at the top-left of the worksheet grid, then choose Home > Format > AutoFit Column Width. You can also select the worksheet and double-click a column boundary. Review the result if long entries make some columns excessively wide.
Why does AutoFit not make a row tall enough for wrapped text?
Check that Wrap Text is enabled, that the correct row is selected, and that the cell is not merged. Then run AutoFit Row Height. A fixed row height or protected sheet can also stop the expected adjustment.
Does AutoFit keep working when I add new data?
No. AutoFit sizes cells based on their contents when you run the command; it is not a continuous resizing rule. Run it again after adding longer entries, or use a consistent manual width with wrapping.
Why does AutoFit make a column too wide?
A long value, extra spaces, or an unbroken URL may be the widest displayed content in the column. Shorten or clean the value, wrap text, or set a manual width if fitting every character on one line is not important.
Related
- Combine Excel Files: Practical Methods and Steps
- What Column Number Is V in Excel? Find It in Seconds
- How to Combine Two Cells in Excel and Keep Both Values
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- Excel Name Already Exists Error: Causes and FixesThe Excel name already exists message usually means the name you are trying to create or bring into…
- Bloomberg Export to Excel Not Working? Troubleshooting GuideIf Bloomberg will not export to Excel, first identify whether the failure is in a Terminal export or…
- Excel VLOOKUP #SPILL! Error: How to Fix It Step by StepTo fix a #SPILL! error in Excel VLOOKUP, first check whether the formula is trying to return results…
- Excel Not Allowing Insert Row? How to Fix ItIf Excel won’t let you insert a row, first check whether the sheet is protected, then check whether…
- Excel Column Filter Dropdown: How to Add, Use, and Fix ItIn Excel for Microsoft 365 on Windows, select a cell in your data and choose Data > Filter…
- Excel Spill Error: Why It Happens and How to Fix ItExcel shows a #SPILL! error when a formula returns multiple results but Excel cannot place those results in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.