How to Delete Every Other Row in Excel

Method 1 – Using Filter Feature to Delete Every Other Row in Excel

Step 1:

  • Select the column header. From your Home Tab, go to the Editing Ribbon and select Sort & Filter.

Apply the Filter Feature to Delete Every Other Row in Excel

  • Each column header now has a filter icon.

Apply the Filter Feature to Delete Every Other Row in Excel

Step 2:

  • Delete those rows that do not have Zero Products Sold.
  • Select the Products Sold column and click the Drop-Down icon in the column.
  • Select Zero to keep it and filter out the rest.
  • Click OK to continue.

Apply the Filter Feature to Delete Every Other Row in Excel

  • The Filter command deletes every other row.

Apply the Filter Feature to Delete Every Other Row in Excel

  • You can also keep all the rows without zero values and delete rows that have zeros. Open the Filter option, select the zero option, and select the rest.

Apply the Filter Feature to Delete Every Other Row in Excel

  • Using the Filter feature, you can delete every other row in Excel.

Apply the Filter Feature to Delete Every Other Row in Excel


Method 2 – Inserting ISEVEN and ROW Functions to Delete Every Other Row

Step 1:

  • You need a Helper Column to apply the formula.

Insert a Formula to Delete Every Other Row in Excel

Step 2:

  • In Cell E4 of the Helper Column, apply the ISEVEN with the ROW. The formula is:
=ISEVEN(ROW())
  • This formula will return TRUE for all EVEN rows and FALSE for all ODD.

Insert a Formula to Delete Every Other Row in Excel

  • Press Enter.

Insert a Formula to Delete Every Other Row in Excel

  • Apply the formula to the rest of the cells.

Insert a Formula to Delete Every Other Row in Excel

Step 3:

  • Filter out the true or false values. Select your column header; go to Data Tab, and click on Filter from Sort & Filter Ribbon to apply the filter option.

Insert a Formula to Delete Every Other Row in Excel

  • You added a filter option to every column.

Insert a Formula to Delete Every Other Row in Excel

  • If you need to delete the even rows, open the filter option, select TRUE to keep those even rows and filter every other row. Click OK to proceed.

Insert a Formula to Delete Every Other Row in Excel

  • Only the even rows remained.

Insert a Formula to Delete Every Other Row in Excel

  • Select then all and right-click on the mouse to open options. Choose Delete Row.

Insert a Formula to Delete Every Other Row in Excel

  • A warning message box appears. Click OK to confirm.

Insert a Formula to Delete Every Other Row in Excel

  • The dataset is blank now. Click the Helper Column‘s drop-down icon. Select FALSE to restore those rows.

Insert a Formula to Delete Every Other Row in Excel

  • There are only ODD rows in the dataset.

Insert a Formula to Delete Every Other Row in Excel


Method 3 – Use MOD and ROW Functions to Delete Every Nth Row in Excel

Step 1:

  • In Cell E5, apply the MOD function with the ROW. The formula is:
=MOD(ROW(),3)=1
  • This formula returns TRUE for every third row and FALSE for every other.

Insert a Formula to Delete Every Other Row in Excel

  • Enter to get the result. Apply the same formula to the rest of the cells.

Use a Formula to Delete Every Nth Row in Excel

Step 2:

  • Delete every third row here. Add the filter option to your column header, and from the option, select FALSE to keep them and delete every other row.

Use a Formula to Delete Every Nth Row in Excel

  • Our task is complete.

Use a Formula to Delete Every Nth Row in Excel


Method 4 – Applying Excel VBA Codes to Delete Every Other Row

Step 1:

  • Go to the Developer Tab and click on Visual Basic to open the VBA. Alternatively, you can press Alt+F11 to open it.

Run VBA Codes to Delete Every Other Row in Excel

  • Click Insert in the VBA window, and from the option select Module to insert one.

Run VBA Codes to Delete Every Other Row in Excel

Step 2:

  • Write the code by copying and pasting it. This code will delete every second row from your dataset.
Sub DeleteEveryOtherRow()
'Delete Row
Dim rng As Range
Dim InputRng As Range
xTitleId = "Delete Row Using VBA"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
Application.ScreenUpdating = False
For i = InputRng.Rows.Count To 1 Step -2
            Set rng = InputRng.Cells(i, 1)
    rng.EntireRow.Delete
Next
Application.ScreenUpdating = True
End Sub

Run VBA Codes to Delete Every Other Row in Excel

  • Click Run to run the code, or press F5.

Run VBA Codes to Delete Every Other Row in Excel

Step 3:

  • Select the dataset from the worksheet ($B$4:$D$13).

Run VBA Codes to Delete Every Other Row in Excel

  • Click OK, and every second row will be deleted from the dataset.

Run VBA Codes to Delete Every Other Row in Excel


Things to Remember

The MOD with the ROW formula will return FALSE to every third row from the main worksheet.

The VBA code provided in this article will delete every second row from the dataset.


Download Practice Workbook

Download this practice book to exercise the task while reading this article.


Related Article


<< Go Back to Delete Rows | Rows in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Asikul Himel
Asikul Himel

Asikul Islam Himel, holding a BSc in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology, has contributed over two years to the ExcelDemy project. Starting as an Excel & VBA Content Developer, now he manages projects at You Have Got This Math Project. He wrote 60+ articles for ExcelDemy, reviewed 500+, and focused on quality maintenance. Currently, his responsibilities include project management and team leadership. Himel's interests encompass data analysis, leadership, WordPress applications, and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo