Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Deleting Every X Rows without a Macro.

Deleting Every X Rows without a Macro

Written by Allen Wyatt (last updated April 4, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


4

When working with data retrieved from another source—such as another user or from an external program—you may have a need to remove certain rows from the data. It is not unusual, for instance, to have the need to remove every third row or every fifth row. The following general steps allow you to delete every X rows without using a macro.

  1. Insert two columns (A and B) on the far-left side of the worksheet.
  2. In the new column A, use AutoFill to sequentially number the rows from 1 to the end.
  3. In cell B1 (assuming you have no header row), enter the formula =MOD(A1,3). (This formula assumes that you want to delete every third row. If you want to delete some other multiple of rows, substitute that number in place of the 3 in the formula.)
  4. Copy the formula downward to all the other cells in the B column.
  5. Display the Data tab of the ribbon.
  6. Click the Filter tool, in the Sort & Filter group. Excel displays small drop-down arrows beside the header row cells.
  7. Using the drop-down list in column B, select the 0. Now, only those rows with a zero in column B appear.
  8. Select all the displayed rows and delete them.
  9. Turn off AutoFilter. (Repeat steps 5 and 6 to do this.)
  10. Delete columns A and B.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6123) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Deleting Every X Rows without a Macro.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Adjusting Margins in Print Preview

Print Preview is a great way to give a document the final "once over" before printing. Word allows you to do some minimal ...

Discover More

Saving Your Web Page

Want to save your document as a Web page? It's easy to do in Word; almost as easy as saving your document normally.

Discover More

Changing Width and Height to Inches

Want to set the width and height of a row and column by specifying a number of inches? It's not quite as straightforward ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Inserting Rows

Need to insert rows in your worksheet? Excel provides a few techniques you can use to do this. Here are some ideas you ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one less than 9?

2020-06-22 12:36:52

Neil

I see a pattern like 1,2,3,1,2,3 CAN be auto-populated if it is formatted as text before being entered.


2020-06-22 12:18:47

Neil

nevermind, autofill won't work that way. That's pretty dumb of excel not to be able to detect a pattern like that.


2020-06-22 12:12:52

Neil

Or, you could just use one helper column and put, in this case, 1,2,3,1,2,3 and autofill the rest of the way down and then filter for the number 3 and delete those rows.


2020-06-20 14:10:52

Frank Moore

Wow. This is another great tip. I frequently have this problem when I import a CSV file. Thank you very much.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.