Excel has no single “trim empty cells” command. To remove blank cells from a selected range, select the range, choose Home > Find & Select > Go To Special > Blanks, then delete the selected cells and choose whether to shift nearby cells or remove whole rows; to trim text spaces, use the TRIM function instead.
What “trim empty cells” can mean in Excel
The phrase can describe several different tasks, and choosing the right one matters. You might want to close gaps inside a list, delete entirely blank rows, remove unused-looking rows and columns at the edge of a worksheet, or strip extra spaces from text. These are separate operations in Excel, with different effects.
A genuinely empty cell contains no value or formula. A cell that looks empty may instead contain a space, a formula that returns an empty string, or formatting such as a fill color. Excel treats those cases differently when you select blanks, filter data, or calculate results. Before deleting anything, decide whether you mean empty cells within a data range or unused worksheet space beyond your data.
For example, if a list has a missing entry between two names, deleting that one blank cell and shifting cells up may be suitable. If each row represents one customer with information in several columns, shifting just one column can mismatch the records. In that situation, delete the entire row only if every cell in it is blank.
Delete blank cells inside a selected range
Use Go To Special when you want to find genuinely empty cells in a defined area. Work on a copy first if the range contains related columns or formulas, and select only the area you intend to clean. Selecting an entire worksheet may include many cells that are blank by design.
- Select the range to inspect, such as A2:D100.
- On the Home tab, choose Find & Select > Go To Special.
- Select Blanks, then choose OK. Excel highlights the empty cells in the selected range.
- Choose Home > Delete > Delete Cells, or press Ctrl+- on Windows to open the Delete dialog.
- Choose Shift cells up or Shift cells left, depending on how the data is arranged, and confirm.
On Excel for Mac, the ribbon command is also available through Home > Find & Select > Go To Special. The keyboard shortcut for Go To is Control+G on Mac; shortcut behavior can depend on the keyboard and Excel version. Use the ribbon command if a shortcut behaves differently. On the web, ribbon labels and available selection options can vary, so check the current interface before applying a bulk deletion.
Shifting is appropriate only when the remaining values should close the gap in that particular direction. If records span multiple columns, deleting isolated blanks can scramble the relationships between values. For example, removing a blank from the middle of a “City” column while leaving the “Customer” column untouched can pair the wrong city with a customer.
Remove completely blank rows or columns
If each record occupies a full row, remove only rows that are blank across all relevant columns. One dependable approach is to filter a column that every valid record must contain, then inspect and delete rows where that key field is empty. Another is to select a bounded data range, use Go To Special > Blanks, and assess the results before deleting entire rows. The latter selection highlights every blank cell, not just rows that are entirely empty, so do not use it as an automatic signal to delete rows.
To delete a row you have verified is wholly blank, select its row number at the left edge and choose Home > Delete > Delete Sheet Rows. To remove a blank column, select its column letter and choose Home > Delete > Delete Sheet Columns. You can select several confirmed blank row or column headers before using the delete command.
Filtering can be safer for a structured list because it lets you examine the records that have an empty key value before removing them. Click in the data, choose Data > Filter, open the filter arrow for a required field, and select (Blanks). Check that the displayed rows are truly expendable before selecting their row headers and deleting them. Clear the filter afterward to review the remaining records.
Trim unused worksheet space and the used range
Excel worksheets always have a fixed grid: 1,048,576 rows and 16,384 columns. Deleting rows or columns does not shrink those worksheet limits. People often say they want to “trim” a sheet when they really want to remove an oversized used range, reduce scrolling, or make a workbook smaller.
Press Ctrl+End on Windows to move to the last cell Excel regards as used. If it lands far below or to the right of your actual data, formatting or past editing may be extending the used area. On Mac, Control+End is commonly the equivalent, though laptop keyboards may require an Fn key. This check is a clue, not a guarantee that every cell before that point contains data.
If the excess area is genuinely unused, select the rows below your last real data row and choose Home > Delete > Delete Sheet Rows. Repeat for columns to the right of your last real data column using Delete Sheet Columns. Save the workbook, close it, and reopen it before checking Ctrl+End again; Excel may update the used range after saving. Deleting whole rows or columns can affect references, so review formulas, print settings, and any content that may sit farther down or across the sheet first.
Clearing is not the same as deleting. Home > Clear > Clear All removes cell contents and formatting but does not remove rows or columns from the worksheet grid. Deleting a row or column shifts or removes its position and may change references. If you only want to remove a colored fill or a border that makes blank cells look occupied, clear formats rather than deleting cells.
Remove extra spaces from text
If “trim” refers to text cleanup, the TRIM function removes leading and trailing ordinary spaces and reduces repeated ordinary spaces between words to one. It does not delete empty cells or change the worksheet’s layout.
With text in A2, enter =TRIM(A2) in another cell and fill the formula down the column. If A2 contains West Harbor with ordinary spaces, the result is West Harbor. To replace the original values, copy the cleaned results and use Paste Special > Values over the original data, after checking that the results are correct.
TRIM does not remove every character that looks like a space. Web pages and copied data can contain a nonbreaking space, character 160, which may remain after TRIM. With the original text in A2, use =TRIM(SUBSTITUTE(A2,CHAR(160)," ")) to replace that character with an ordinary space before trimming. For other unwanted nonprinting characters, CLEAN can help, but it is not a universal fix for every Unicode character. Inspect the source when odd spacing persists.
Blanks, formulas, and cells that only look empty
Go To Special > Blanks finds cells that Excel considers empty; it does not find every cell that appears blank on screen. A cell containing a formula such as one that returns an empty string is not truly empty, even if nothing visible appears in it. A cell containing a single space is also not empty. These distinctions explain why a blank-looking row may not be selected by the Blanks command.
To check a suspicious cell, select it and look at the formula bar. If a formula is present, deleting the cell may remove logic that the workbook depends on. If the cell contains a space, editing it and pressing Delete can clear the content. For large datasets, use a filter or a helper column to identify the exact condition you want to remove rather than relying on appearance alone.
A formula that displays an empty string is not a way to physically erase a cell. It remains a formula cell and may affect counts or later processing. For instance, COUNTBLANK can count cells containing formulas that return empty text, while ISBLANK returns FALSE for a cell that contains a formula. The right test depends on whether you mean “nothing visible” or “no content at all.”
Choose the safest cleanup method
Match the operation to the structure and purpose of the data. Before a large cleanup, save a separate copy of the workbook or use Undo immediately if the result is not what you expected. Deletion can shift values, alter references, or remove data that is outside the visible portion of a filtered list.
- Use Shift cells up or Shift cells left for isolated gaps only when other columns do not need to stay aligned.
- Delete entire rows when each row is one record and you have confirmed every relevant cell in the row is empty.
- Delete entire columns only when the column has no required data, formulas, or references.
- Use TRIM or a related text-cleaning formula for unwanted spaces in text, not for worksheet blanks.
- Clear formatting when blank cells merely have unwanted colors, borders, or styles.
For recurring imports, consider making cleanup part of a repeatable workflow rather than manually deleting cells each time. Excel’s Power Query can transform tabular data, including filtering rows, before loading the result to a worksheet. It is useful when the same source is cleaned repeatedly, but it is a data-transformation tool, not a command that trims the worksheet’s physical grid.
Common problems and how to avoid them
A frequent mistake is selecting Blanks across multiple columns and then shifting cells up. If the columns represent fields in the same records, the shift can misalign names, dates, and amounts. Restrict the selection to a single independent list, or delete complete confirmed blank rows instead.
Another problem is assuming that the visible blank space at the bottom of a sheet is a large set of removable cells. Excel’s grid remains in place. You can remove unused rows or columns from the used range, but the worksheet still has its standard maximum dimensions. If the file remains large, check for embedded objects, extensive formatting, formulas, or other sheets as well; blank-looking cells are not the only possible cause.
If Go To Special does not select a cell you expected, check for a formula, a space, or another hidden character. If Ctrl+End goes too far, inspect and remove unintended content or formatting carefully, then save and reopen the workbook. If a cleanup changes formulas unexpectedly, use Undo promptly or restore your saved copy rather than trying to reconstruct the original data by guesswork.
Frequently Asked Questions
Does Excel have a Trim Empty Cells button?
No. Use Go To Special > Blanks to select truly empty cells in a chosen range, then delete them with an appropriate shift option. Use the TRIM function when the problem is extra spaces in text.
How do I delete blank rows without shifting individual cells?
Verify that the rows are blank across the columns that matter, select their row headers, and choose Home > Delete > Delete Sheet Rows. Filtering a required field for blanks can help you identify candidate rows first.
Why does Go To Special skip a cell that looks blank?
The cell may contain a space, a formula returning an empty string, or another character. Select it and inspect the formula bar; visual appearance alone does not show whether a cell is truly empty.
Does TRIM remove blank cells?
No. TRIM cleans ordinary spaces in text values. It does not delete worksheet cells, rows, or columns. Use Go To Special or the delete commands for those tasks.
Can I make an Excel worksheet smaller by deleting empty rows?
You can delete unused rows or columns and may reduce an unnecessarily large used range, but Excel’s worksheet grid keeps its fixed maximum dimensions. Save and reopen the workbook before checking whether Ctrl+End now lands closer to your data.
Related
- Excel Timesheet Format: Build a Reliable Weekly Sheet
- Excel Timesheet for Multiple Employees: Setup and Tips
- Excel Invoice Bill Format: Build a Useful Template
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Sort Shortcut: Sort Your Data Quickly and SafelyIn Excel for Microsoft 365 on Windows, press Alt, A, S, S in sequence to open the Sort…
- Excel Merge Cells Per Row: The Right Way to Do ItTo merge cells separately across each row in Excel for Microsoft 365 on Windows, select the full range…
- Excel WORKDAY Formula: Does It Exclude Weekends?Yes. In Microsoft Excel for Microsoft 365 on Windows, WORKDAY excludes Saturday and Sunday by default when it…
- Excel FV Function Examples: How to Calculate Future ValueExcel’s FV function calculates the future value of an investment or savings plan from a fixed interest rate…
- Count Unique Values in Excel with a Simple FormulaTo count distinct, nonblank entries in a column in Microsoft 365, enter =IFERROR(ROWS(UNIQUE(FILTER(A2:A100,A2:A100<>""))),0) in an empty cell, replacing…
- Excel Find and Replace: Values, Formulas, and OptionsTo find and replace values in Excel, press Ctrl+H on Windows, enter the text or value under Find…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.