Removing extra space in Excel cells is a quick way to clean up messy data, prevent misaligned text, or make formatting consistent. Whether you have accidental spaces between characters, hidden formatting causing gaps, or text wrapping issues, there are straightforward solutions. You’ll need Excel (2010 or newer) and a basic understanding of how cell formatting works—no advanced skills required.
What You'll Need
- A Microsoft Excel file (open in Excel 2010 or later)
- Right-click or keyboard shortcut access (Ctrl+Z for undo)
- A spreadsheet with cells containing unwanted spaces
Step-by-Step
- Identify the extra space type:
- If spaces appear between words (e.g., "Hello world"), they’re likely from hidden formatting or merged cells.
- If spaces appear at the start or end of a cell, they’re probably from text alignment or hidden characters.
- If cells are wrapping incorrectly, check text wrapping settings.
Labels may differ slightly by version or region, but the same process applies. - Remove hidden characters:
Use the "Remove Hidden Characters" feature (Excel 2016+):
- Select the cell or range with extra spaces.
- Press Alt+F11 to open the VBA editor.
- Paste this code into the module:
Sub RemoveHiddenChars() Dim rng As Range For Each rng In Selection rng.Replace What:=ChrW(10), Replacement:="" Next rng End Sub - Run the macro (F5). Hidden spaces (including carriage returns) will disappear.
This won’t affect visible spaces—only hidden formatting like tabs or line breaks. - Delete extra spaces between words manually:
- Select the problematic cell and press Ctrl+Shift+Enter to edit the entire range.
- Delete spaces between words using the arrow keys or backspace.
- Press Ctrl+Enter to apply changes to the entire selection.
For large ranges, use Excel’s "Find and Replace" feature:- Press Ctrl+H, then enter spaces as " " (two spaces) in the "Find what" box.
- Leave "Replace with" empty.
- Check "Wrap around" and click "Replace All."
- Fix text alignment and wrapping:
- Right-click the cell and choose "Format Cells".
- Go to the "Alignment" tab.
- Select "Center" or "Left" (avoid "Justify" which adds spaces).
- Under "Wrap text", uncheck it if needed.
- Click OK.
For merged cells causing extra spacing, right-click and select "Unmerge Cells".
Common Mistakes
- Not checking hidden characters: Many users assume spaces are visible, but hidden formatting (like carriage returns) often causes the issue. Always inspect with Ctrl+F9 (toggle hidden characters).
- Using "Justify" alignment: This forces words to fill the cell width, adding unwanted spaces between them. Always use Center or Left alignment instead.
- Not applying changes to the entire range: If you edit a single cell, the extra space might reappear when you expand the selection. Use Ctrl+Shift+Enter for multi-cell edits.
- Skipping the "Format Cells" step for wrapping: If text is wrapping but the cell still shows gaps, you must disable "Wrap text" in the format settings.
Tips
- For large datasets: Use the "Find and Replace" trick with Ctrl+H to target spaces between words instead of replacing all spaces.
- Prevent future issues: Avoid using "Merge Cells" unless absolutely necessary—it can introduce formatting inconsistencies.
- Check for merged cells: Right-click the cell and see if "Merge Cells" is listed; if so, unmerge it first.
- Use `TRIM()` function: For advanced users, enter `=TRIM(A1)` in a new cell to remove extra spaces from text stored in a cell.
- Save as CSV: If formatting persists, export to CSV (File > Save As > CSV) and re-import to reset formatting.
Troubleshooting
If removing spaces doesn’t work: If extra space remains after trying all steps above, try these advanced fixes:
- Clear cell contents and re-enter data:
- Select the cell(s), press Ctrl+; to fill with zeros.
- Delete all data and re-type it.
- This resets the cell’s formatting.
- Check for conflicting themes:
- Go to Home > Cell Styles > Clear Formatting or Home > Font > Normal.
- Delete the theme if it’s causing formatting issues.
- Enable "Show All Characters":
- Press Ctrl+F9 to show hidden characters.
- Look for hidden tabs, line breaks, or special characters (e.g., ¶).
- Delete them directly.
- Update Excel: Ensure you’re using the latest version via File > Account > Manage Excel Licenses > Update Now.
If the issue persists: Export the file to a blank Excel template (File > Open > Browse > Select "Blank Workbook.xltm") and re-import your data. This forces a clean slate.
Frequently Asked Questions
Why do my cells keep showing extra spaces after I format them?
Extra spaces often come from hidden formatting like merged cells, carriage returns, or font settings. Use Ctrl+F9 to show hidden characters, and manually delete them. If merged cells are involved, unmerge them first.
Can I permanently remove spaces between words without editing each cell individually?
Yes! Use Excel’s Find and Replace feature (Ctrl+H) and replace spaces between words with nothing—a single click for large datasets.
Why does my text wrap and show extra space, but "Wrap text" is unchecked?
If text wrapping is enabled but the cell still shows gaps, check the "Alignment" tab in Format Cells. Some older versions may require disabling both "Wrap text" and "Shrink to Fit."
What if my extra spaces are caused by a font's "Shrink to Fit" setting?
Go to the cell’s Format Cells settings > Font tab, uncheck "Shrink to Fit," and click OK. This removes forced spacing adjustments.
How do I remove spaces introduced by a formula?
If the issue stems from formulas like `CONCATENATE(A1," ",B1)`, clean the underlying data first. Use `TRIM()` in a helper cell to manually remove unwanted spaces.
Will removing hidden characters affect my formulas?
No, only visible formatting matters for formulas. Hidden characters (like tabs) won’t break calculations unless they alter the text’s structure.