5 Ways to Delete Every nth Row in Excel

In this lesson, Iโ€™ll demonstrate 5 effective approaches to delete every nth row in Excel. Moreover, these techniques will enable you to solve the problem that led you here. However, you will master several crucial Excel features and functions during this article, which will come in extremely handy for any assignment using Excel.


๐Ÿ“ Download Excel File

The sample worksheet that was used during the discussion is available to download for free right here.


Learn to Delete Every nth Row in Excel with These 5 Methods

Here in this article, we will learn how to delete every nth row in Excel using different approaches. To be exact, Iโ€™ve provided a total of 5 methods.


Method 1

1. Using Find and Replace Tool with Special Characters

Here we will be applying special characters to delete every nth row in a dataset in Excel. We will be using the Find and Replace Tool in this section. For instance, letโ€™s say we will delete every 3 interval row from the dataset.

โฌ‡๏ธโฌ‡๏ธ STEPS โฌ‡๏ธโฌ‡๏ธ

  • Firstly, we will create a new column for the special characters. As we want the 3rd row to be deleted. We will add special characters until the 3rd row.

  • Now copy down first three data along the column by putting your mouse cursor in the bottom right corner of the three selected cells and dragging down to the last cell of the column.

delete every nth row in excel using special characters

After dragging down to the last cell, by this, we are basically denoting every 3 interval rows of the dataset.

delete every nth row in excel using find and replace

  • Now press Ctrl+H to open up the Find and Replace Tool. Select the Find option type in โ€œ@โ€ in the Find What field and press on Find All.

delete every nth row in excel Find and replace

  • Select all the rows using Ctrl and click on every Row and close the window.

delete every nth row in excel Using Find and replace sorting data

  • As you can see, every 3 interval rows of the Special character column is selected.

  • Now go to the Home tab from the ribbon.

  • At the right side of the toolbar, youโ€™ll see the Delete option like the picture below. Select Delete Sheet Rows from the Delete.

delete every nth row in excel delete option

  • Youโ€™ll see the following result as every 3 interval rows has been deleted now which had the character value โ€œ@โ€ in their special character column.

delete every nth row in excel results

๐Ÿ“• Read More: 9 Ways to Delete Unused Rows in Excel


Method 2

2. Implying MOD Function and Filter Tool

Here we will be usingย  MOD function and the Filter Tool to delete in 4-row differences in a dataset in Excel. We will be using the Filter Tool for deleting and MOD function for denoting every 4th row in this section. MOD returns the remainder, once the integer has been divided by the divisor.

ย โฌ‡๏ธโฌ‡๏ธ STEPS โฌ‡๏ธโฌ‡๏ธ

  • First, we need to create a counter column to get the serial of the rows. For that, copy down the formula. This function returns the value of the Row number.

=ROW(A1)

  • Now use MOD function to specify every 4th Row of the dataset. For that, we are going to use this formula.

=MOD(E6,4)

delete every nth row in excel MOD function

  • Copy down along the column.

  • Now, we can say that every 4th Row has 0 in the MODย column. Select the Whole dataset including the column Headers and go to the Filter option from the Data tab of the ribbon.

  • Youโ€™ll see a dropdown button for each column as a result.

filtered data

  • After that, select the drop-down button of the MOD column select the 0 option. Then press OK.

delete every nth row in excel filtering out data

  • These are the filtered values for you here.

  • Now simply select the rows by dragging the mouse cursor and then right-click to open up options. After that select the Delete Row option.

  • After deleting click on the Filter option again to show the remaining dataset.

๐Ÿ“• Read More: 5 Ways to Remove Blank Rows Using Formula in Excel


Method 3

3. Applying Mod Function with ROW Function

Here we will be using the MOD with ROW functions to delete every 4th row in a dataset in Excel. We will be using the Filter Tool for deleting and the formula for denoting every 4th row in this section. MOD function returns the remainder, once the integer has been divided by the divisor.

ย โฌ‡๏ธโฌ‡๏ธ STEPS โฌ‡๏ธโฌ‡๏ธ

  • Firstly, select and use the formula in the formula bar.

=MOD(ROW(A6)-5,4)

๐Ÿ”จย  ย Formula Breakdown

๐Ÿ‘‰ย  ROW(A6)

The ROW function denotes row number of cell A6 which is 6.

๐Ÿ‘‰ย  MOD(ROW(A6)-5,4)

Here the MODย returns the remainder by dividing (6-5) by 4.

๐Ÿ‘‰ย  Output- 1.

delete every nth row in excel using MOD and ROW function

  • Press Enter and copy down the formula to apply the results to all the cells of the column.

  • Now, we can say that every 4th Row has 0 in the MOD Column. Select the Whole dataset including the column Headers and go to the Filter option from the Data tab of the ribbon.

  • Youโ€™ll see a dropdown button for each column as a result.

  • After that, select the dropdown button of the MOD column, select the 0 option, and then press OK.

delete every nth row in excel using FILTER tool

  • These are the filtered values for you here.

  • Now simply select the rows by dragging the mouse cursor and then right click to open up options. After that select the Delete Row option.

  • After deleting click on the Filter option again to show the remaining dataset.


Method 4

4. Utilizing ISEVEN Function

Here we will be utilizing special characters to delete every nth row in a dataset in Excel. We will be using ISEVEN function in this section. For instance, letโ€™s say we will delete every 2nd row from the dataset. So we will find which rows are even numbered and which are odd-numbered.

โฌ‡๏ธโฌ‡๏ธ STEPS โฌ‡๏ธโฌ‡๏ธ

  • Firstly, write down the formula to find which rows are even numbered.

=ISEVEN(ROW())

๐Ÿ”จ ย  Formula Breakdown

๐Ÿ‘‰ย  ROW()

The ROW function denotes row number of the corresponding cell.

๐Ÿ‘‰ย  ISEVEN(ROW())

Here, ISEVEN returns TRUE if the Row number is Even and FALSE if the row number is Odd.

๐Ÿ‘‰ย  Output- FALSE for cell E5.

delete every nth row in excel using ISEVEN and ROW functions

  • Press Enter and copy down the formula along the column.

  • Now that we have successfully found all the rows which are even and odd we can simply use the Filter Tool like the other methods stated above and delete every 2nd Rows which are denoted by True.

  • Pressing OK we will see these filtered out data. Now we will simply select all the rows by dragging the mouse cursor.

  • Delete the rows by selecting them except the headers and clicking on the Delete Tool from the Home tab of the ribbon.

The result will be like the following picture.


Method 5

5. Embedding VBA Code

Here we will be using a VBA code to delete when it comes to every nth row in a dataset in Excel. For instance, letโ€™s say we will delete every 3 rows from the dataset. Iโ€™m providing the necessary steps to demonstrate the process.

โฌ‡๏ธโฌ‡๏ธ STEPS โฌ‡๏ธโฌ‡๏ธ

  • After that, a new window will pop-up select Module from the Insert option of the window.

VBA

  • Copy the following code and save this code. It is modified so that we can delete every 3-row intervals from the Dataset, you can customize the code as per your need.
Sub NthRowRemoval()
Dim xDataRange As Range
Set xDataRange = Application.InputBox("Please select the dataset (Without headers)", "Range Selection", Type:=8)
For xRCount = xDataRange.Rows.Count To 1 Step -3
If xRCount Mod 3 = 0 Then
xDataRange.Rows(xRCount).Delete
End If
Next xRCount
End Sub

delete every nth row in excel VBA code

  • Now go to the Macros option from the Developer tab of the ribbon and Run the code.

  • Select the dataset without the column headers and click OK.

delete every nth row in excel VBA code results

  • Youโ€™ll see the following result as every 3 interval row is deleted.


๐Ÿ“„ Important Notes

๐Ÿ–Š๏ธย  Be careful while using the code as there are a lot of terms and if you lose concentration the code may be incorrect.

๐Ÿ–Š๏ธย  Use shortcuts to reduce time.

๐Ÿ–Š๏ธย  While writing formulas carefully see the suggestions and donโ€™t forget the commas and parentheses.

๐Ÿ–Š๏ธย  Be careful while defining criteria to be accurate as the dataset.

๐Ÿ–Š๏ธย  If you download macro enabled Excel file donโ€™t forget to unblock the file from the properties menu.


๐Ÿ“ Takeaways from This Article

๐Ÿ“Œย  Use of ISEVEN, MOD, and ROW functions.

๐Ÿ“Œย  How to convert a column into comma-separated list with single quotes.

๐Ÿ“Œย  Creating formulas using multiple functions.

๐Ÿ“Œย  Method to delete specific rows with the help of the Filter tool.

๐Ÿ“Œย  How to use VBA codes to solve a problem.

๐Ÿ“Œย  Different use of the Find and Replace Tool.


Conclusion

Firstly, I hope you were able to use the techniques I demonstrated in this Delete Every nth Row in Excel lesson. As you can see, there are a lot of options on how to do this. However, decide deliberately on the approach that best addresses your circumstance. Most importantly I advise repeating the steps if you become confused in any of the steps if you get stuck. Practice on your own after taking a look at the Excel file in the practice workbook as Iโ€™ve provided above because practice makes a man perfect. Above all, I earnestly hope you can use it. Please share your experience with us in the comment box about how your experience was throughout the article and what we need to improve or add to make things better for you folks. However, if you have any problem regarding Excel spit it in the comment box. The Excelden crew is always available to answer your questions. In conclusion, keep educating yourself by reading. For more Excel-related articles please visit our website Excelden.com.

(Visited 51 times, 1 visits today)
Nashid

Nashid

Hello there. I am Nashid, an Engineer. I Love music, traveling, sports and gaming. I have recently grown interest in DATA SCIENCE and wish to build a career over it. Excel is one of the greatest modern digital creation of human. Life simply gets easier. My Articles are meant to lead you to that easier life with efficiency. If you need any kind of help regarding my articles even anything else try contacting me on social platforms of which I've provided. Keep learning. Wish me luck and Thank you.

We will be happy to hear your thoughts

Leave a reply

ExcelDen
Logo