Fix Excel AutoFit Row Height Not Adjusting to Formula Results
Question details
The user is unable to get the AutoFit row height feature to adjust automatically when a cell contains text generated by a formula.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Attempting to auto-size row heights so that dynamic formula results with varying text lengths are fully visible without manual adjustment.
- Observed behavior
- The row height remains static or truncates the text, rather than expanding vertically to display the full formula result.
Verify that the worksheet is not protected, as worksheet protection can lock cell formatting and prevent row heights from being adjusted.
Enable Wrap Text and Change Alignment to General
AutoFit requires 'Wrap Text' to be enabled and the horizontal alignment set to 'General' to properly calculate and adjust the row height for formula text.
When horizontal alignment is set to 'Fill' or 'Wrap Text' is disabled, Excel does not know it needs to expand vertically. If adjacent cells are empty, disabled wrap text causes the text to simply overflow horizontally. Fixing these two settings forces the row to expand downward based on the formula result.
Highlight the specific cell or range of cells containing the formula results that are not displaying correctly.
Right-click the selected cells and click 'Format Cells' from the context menu, or press the 'Ctrl + 1' keyboard shortcut.
Navigate to the 'Alignment' tab. Click the 'Horizontal' drop-down menu and select 'General'. Ensure it is not set to 'Fill'.
Under the 'Text control' section on the same tab, check the box next to 'Wrap text' and click 'OK'.
Move your cursor to the row header on the left side of the screen. Double-click the bottom boundary line of the affected row to automatically adjust the height.

Easily Format Cells and AutoFit Rows in WPS Spreadsheet
WPS Office provides a highly compatible and intuitive Spreadsheet tool that effortlessly handles complex formatting, formulas, and AutoFit functions to keep your data perfectly visible.
- 1. Open your workbook: Launch WPS Spreadsheet and open your Excel workbook.
- 2. Select formula cells: Highlight the cells containing your formulas.
- 3. Apply Wrap Text: Click the 'Wrap Text' button located in the Home tab toolbar.
- 4. AutoFit Row Height: Go to Home > Format, then select 'AutoFit Row Height' to instantly expand the cells.

Frequently Asked Questions
Why does AutoFit work on typed text but not formula results?
AutoFit sometimes fails to trigger automatically when formula outputs change dynamically in the background. You must ensure 'Wrap Text' is turned on and re-trigger AutoFit by double-clicking the row boundary so the cell calculates the new height based on the output.
Can merged cells affect AutoFit row height?
Yes, Excel's AutoFit feature generally does not work with merged cells. If your formula result is inside a merged cell, you will need to either manually adjust the row height or unmerge the cells to allow AutoFit to function properly.
Is there a keyboard shortcut to AutoFit row height?
Yes, select the row or rows you want to adjust, then press Alt + H, followed by O, and then A in sequence on your keyboard. This triggers the AutoFit Row Height command from the ribbon.




