Remove every 2nd and 3rd row

JoseK70

New Member
Joined
Sep 16, 2011
Messages
6
I have a column and I want to remove every second and third row or delete the information in these rows. Any suggestions?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
There are various different ways.

One simple way without using VBA is to add a "helper" column. Let's say we want to keep rows 1,4,7,... and delete rows 2,3,5,6,8,9,...

We can make use of the MOD function (which returns the remainder of a number when divided by another number (3 in this case) and the ROW() function, which returns the current row number.

So, if we use a "helper" column, and put this formula in and copy down for all rows:
Code:
=IF(MOD(ROW(),3)<>1,"DELETE","")
then all rows we want to remove will have the word "DELETE" in them.

Then you can either use Filters to filter out the "DELETE" rows, or simply sort the range so that all the "DELETE" rows are together and can easily be deleted.

Another alternative would be to use VBA code to loop through your range and delete unwanted rows, using the same sort of logic.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top