How to Expand All Cells in Excel: AutoFit Guide
In this article
To expand all cells in Excel so that the column widths and row heights automatically fit your content, click the Select All button (the triangle in the top-left corner of the grid), then double-click the boundary line between any two column headers or row headers. This action, known as AutoFit, instantly adjusts every cell in the worksheet to accommodate the longest string of text or the tallest piece of data, eliminating the common "###" error and ensuring no data is cut off from view.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- An open Excel workbook containing the data you wish to expand.
- A mouse or trackpad for precise clicking and double-clicking.
Step-by-Step
- Open your Excel Workbook: Launch the application and open the specific file that contains the columns or rows that are too narrow or too short.
- Select the Entire Worksheet: To apply the expansion to every single cell at once, you must select the entire grid. You can do this in two ways. First, click the "Select All" button, which is the small gray triangle located at the intersection of the column letters (A, B, C) and the row numbers (1, 2, 3). Alternatively, you can press
Ctrl + Aon Windows orCommand + Aon a Mac. If your data is inside a formatted Table, you may need to press the shortcut twice to select the entire sheet beyond the table boundaries. - Expand Column Widths (AutoFit Columns): While the entire sheet is highlighted in gray, move your cursor to the top header row. Hover your mouse over the thin vertical line that separates any two column letters (for example, the line between column A and column B). Your cursor will change from a thick white cross to a double-sided arrow. Double-click your left mouse button. Excel will instantly scan every row in every column and set the width of each column to match its longest piece of content.
- Expand Row Heights (AutoFit Rows): If you have wrapped text or large fonts that are being cut off vertically, repeat the process for the rows. With the entire sheet still selected, move your cursor to the left-hand side where the row numbers are. Hover over the horizontal line between any two row numbers (for example, between row 1 and row 2). When the cursor turns into a double-sided vertical arrow, double-click. This will adjust all row heights to fit the content perfectly.
- Verify the Results: Scroll through your data to ensure that no text is truncated and that no cells are displaying hashtags. If some columns are excessively wide due to a single outlier cell with a massive amount of text, you may want to manually adjust those specific columns.
Common Mistakes
One of the most frequent mistakes users make is attempting to double-click the column boundary without selecting the entire sheet first. If you only have one cell selected, double-clicking the boundary will only expand that one specific column. While this works for small sheets, it is inefficient for large datasets. Always ensure the entire grid is highlighted to apply the change globally.
Another common error is confusing "AutoFit" with "Wrap Text." AutoFit expands the width of the cell to keep the text on one single line. Wrap Text, found in the Home tab, keeps the column width the same but increases the row height to stack the text vertically. If you use AutoFit on 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. To get a true horizontal expansion, disable Wrap Text before using the AutoFit double-click method.
Users also occasionally try to drag the column boundary to the right while holding the Select All button. While dragging the boundary of one column while multiple columns are selected will make all those columns the exact same width, it will not "expand to fit." It simply forces a uniform size. To get the cells to expand based on the actual content, you must double-click, not click-and-drag.
Tips
For those who prefer using the ribbon menu over mouse shortcuts, you can find the expansion tools in the Home tab. Navigate to Home > Cells > Format. Under the "Cell Size" section, you will see options for "AutoFit Column Width" and "AutoFit Row Height." This is particularly useful if your mouse is malfunctioning or if you are working on a laptop trackpad where double-clicking is imprecise.
If you have a very large dataset (tens of thousands of rows), AutoFit can sometimes cause a brief freeze as Excel calculates the length of every single cell. To speed this up, you can select only the specific columns that need expanding by clicking the column letters and dragging across, rather than selecting the entire sheet. This limits the calculation load on your processor.
To maintain a professional look, consider using a standard width for most columns and only AutoFitting the ones with critical data. You can do this by selecting multiple columns, right-clicking the header, selecting "Column Width," and entering a specific numerical value (e.g., 15). This prevents your spreadsheet from becoming wildly inconsistent in width if one cell contains a very long paragraph.
Troubleshooting
If you double-click the column boundary and nothing happens, first check if your worksheet is protected. If a sheet is locked, you cannot change column widths or row heights. Go to the Review tab and check if it says "Unprotect Sheet." If it does, click it and enter the password if required to unlock the editing capabilities.
If you see "###" in a cell even after expanding, it usually means the cell is formatted as a Date or Currency and the value is a negative number or too large for the cell. While AutoFit usually fixes this, ensure that the cell format is correct. Right-click the cell, select "Format Cells," and ensure the category matches the data type.
In cases where AutoFit makes a column far wider than you want (because of one single cell with a long sentence), the best solution is to use the Wrap Text feature. Select that specific column, go to the Home tab, and click "Wrap Text." Then, AutoFit the row height instead of the column width. This keeps your spreadsheet readable without requiring horizontal scrolling for miles.
If the Select All button is missing or not responding, try the keyboard shortcut Ctrl + A. If the data is inside an Excel Table (Insert > Table), you may need to press Ctrl + A twice: once to select the table data and a second time to select the entire worksheet.
Frequently Asked Questions
Why do I see hashtags (###) in my cells?
Hashtags appear when a column is too narrow to display the numeric value, date, or time contained within the cell. Expanding the cell width using the AutoFit method described above will resolve this immediately.
Can I expand all cells to a specific uniform size?
Yes. Select the entire sheet, right-click any column letter at the top, select "Column Width," and enter a specific number. This makes all columns identical in size rather than fitting them to the content.
Does AutoFit work on merged cells?
No, AutoFit generally does not work on merged cells. Because merged cells span multiple columns, Excel cannot determine a single "correct" width for the underlying columns. You will have to adjust the width of merged cells manually by dragging the column boundary.
Is there a keyboard shortcut for AutoFit?
Yes, on Windows, you can use the sequence Alt + H, O, I to AutoFit column widths and Alt + H, O, A to AutoFit row heights. These must be pressed sequentially, not all at once.
Will expanding cells change the actual data?
No. Expanding cells only changes the visual presentation of the data. It does not alter the values, formulas, or text contained within the cells; it only changes how much of that data is visible at once.
How do I expand cells in Excel for Web or Mobile?
In Excel for the Web, the process is identical to the desktop version. On the mobile app, tap the column letter to select it, then drag the handle on the right side of the column header to expand it, as double-clicking is not supported on touchscreens.