How to Remove Blank Lines in Excel (7 Methods)

Dataset Overview

In our dataset we have data of different members of a club. Our dataset contains several blank lines. We will delete these empty rows by using 7 different methods.

Sample Dataset to Remove Blank Lines in Excel


Method 1 – Manually Remove Blank Lines

This method is straightforward but best suited for small datasets.

Steps

  • Select the blank lines by holding down the Ctrl key.

Manually Choosing Cells to Remove Blank Lines in Excel

  • Right-click and choose Delete from the available options.

Choosing Delete Option

  • In the Delete prompt, select Shift cells up and click OK.

Deleting by Shifting Cells Up

  • Your dataset will now be free of blank lines.

Manually Remove Blank Lines in Excel

Read More: How to Delete Blank Cells and Shift Data Up in Excel


Method 2 – Applying Keyboard Shortcut

Although manual, this method is faster than the previous one.

Steps

  • Select the blank lines.
  • Press Ctrl + Minus ().

Using Keyboard Short Cut to Remove Blank Lines in Excel

  • Choose Shift cells up from the Delete prompt and click OK.

Shifting Cells Up to Remove Blank Lines in Excel

  • Excel will remove the blank lines.

Applying Keyboard Shortcut


Method 3 – Using Go To Special Command

Steps

  • Select the cell range (e.g., B4:E18).
  • Go to Home > Editing > Find & Select > Go To Special.

Choosing Go To Special Command

  • In the prompt, choose Blanks and click OK.

Selecting Blanks Option to Remove Blank Lines in Excel

  • All blank cells within the dataset will be highlighted.

Highlight Blank Cells

  • Right-click on the blank rows or lines and choose Delete.

Selecting Delete Option

  • Select Shift cells up and click OK.

Shifting Cells Up to Delete

  • Blank lines will be deleted.

Using Go To Special Command to Remove Blank Lines in Excel

Read More: How to Remove Blank Cells from a Range in Excel


Method 4 – Utilizing Find Command

Steps

  • Select the cell range (e.g., B4:E18).
  • Go to Home, select Editing, click on Find & Select and choose Find.

Choosing Find Command to Remove Blank Lines in Excel

  • In the prompt, leave the Find what box blank.
  • Check the Match entire cell contents box.
  • Click Find All.

Finding Blank Cells

  • A list of all blank cells will appear.
  • Choose the blank lines from the list and click Close.

Choosing Blank Lines

  • Blank lines will be highlighted.

Highlighting Blank Lines to Remove Blank Lines in Excel

Utilizing Find Command to Remove Blank Lines in Excel


Method 5 – Implementing Sort Command

Steps

  • Select the cell range B4:E18.
  • Go to Home, select Editing, click on Sort & Filter and choose Sort A to Z.

Choosing Sort Command

  • This will sort the dataset, separating blank lines from non-blank ones.

Selecting Sorted Blank Lines

  • Delete the blank lines as described in the previous method to obtain a dataset without blank lines.

Implementing Sort Command to Remove Blank Lines in Excel


Method 6 – Utilizing Filter Command

Steps

  • Choose the B4:E18 cell range.
  • Go to Data, select Sort & Filter and click on Filter.
  • All column headers will now have a filter handle.

Selecting Filter Command to Remove Blank Lines in Excel

  • Click any filter handle and select the (Blanks) box.
  • Press OK to filter out all blank cells.

Selecting Filter Handle

Filtering Out Blank Lines to Remove Blank Lines in Excel

  • Click the filter handle again, mark the Select All box, and click OK.

Filtering Non-Blank Values

  • Your dataset will be free of blank lines.

Utilizing Filter Command to Remove Blank Lines in Excel

Read More: How to Remove Blank Cells in Excel


Method 7 – Applying FILTER Function

Steps

  • Click on cell B20 and insert:
=FILTER(B5:E18,B5:B18<>"")
  • Press Enter.
  • You’ll get a dataset without blank lines.

Applying FILTER Function to Remove Blank Lines in Excel


Download Practice Workbook

You can download the practice workbook from here:


Related Articles


<< Go Back to Blank Cells | Excel Cells | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Prantick Bala
Prantick Bala

PRANTICK BALA is a marine engineer who loves exploring Excel and VBA programming. Programming, to him, is a time-saving tool for efficiently managing data, files, and internet tasks. He is proficient in Rhino3D, Maxsurf, C++, MS Office, AutoCAD, Excel, and VBA and goes beyond the basics. Armed with a B.Sc in Naval Architecture & Marine Engineering from BUET, he has transitioned into the role of a content developer. Beyond his work, find him immersed in books, exploring new... Read Full Bio

2 Comments
  1. If you need to remove all rows (a similar approach will work with columns) without any values, but can’t sort or use filter, there is an alternate solution.

    – Insert an empty column before the first column.
    – Make the value of A1 `=concat(“somestring”; COUNTA($B2:$ZZ2))` (make sure this covers all columns). The string “somestring” is added to prevent you from removing all rows that contain a cell with the value 0.
    – Drag the corner of A1 down to fill column A for all rows with at least one value.
    – Go to Edit -> Find -> Find.
    – Find “somestring0”. This should find the cells in all empty (except for column A) rows.
    – Click ‘Find All’. Select all results in the resulting list,
    – Go to Edit -> Delete. Select Entire Row and click OK.
    – Remove column A.

    Now all empty row will be removed from your sheet.

    • Hello Peter,

      Thanks for your feedback and solution. Hopefully it would be useful for the users. That’s a clever approach! Using a concatenated string to identify empty rows while avoiding zeros is effective. After you locate those rows with “somestring0,” deleting them is straightforward. This method provides a great alternative when sorting or filtering isn’t an option.

      Regards
      ExcelDemy

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo