How to delete alternating rows in a long Numbers document
I have a long table in Numbers. All the even rows in that table is nonsense data. And I want to delete them from the table. But I don’t want to delete row by row because there are so many. There must be a better way to do it.
And I found a better way. I can mark the rows I want to delete with 0 value, and use 1 value to mark the rows I want to keep. Then I can sort the table based on the value 0 and 1. The lines with 0 value will rise to the top. The lines with 1 value will shrink to the bottom. Finally, I can just delete all the lines at the top.
The detailed instructions are below.
1. Mark the rows with 0 and 1 values
I know I want to delete the even rows. Therefore, if I take the row position and divide by 2, the remainder is 0 on the even rows, and 1 on the odd rows. And I use the below formula to set 0 and 1 values on all the rows in my table.
Let me explain the formula in case you don’t understand. The ROW function gives the row position of the selected cell. The MOD function calculates the remainder of the division between the row position and 2.
Next, I copy that formula to all the rows in my table. I just drag the formula down to the end of the table. You can see the result in the below screenshot. All the even rows have 0 value. And All the odd rows have 1 value.
2. Delete the rows with 0 values
The next task is to sort the table based on 0 and 1 values so that the lines with 0 value rise to the top. Then I select the rows at the top and delete them easily. To sort the table, I click the Organize button, then select column D (the column contains 0 and 1 values), then click the “Start Now” button.
Please note that after I sort the table Mac Numbers recalculate the remainder formula. That’s why you don’t see all 0s on the top rows. But that is okay because Mac Numbers sorts the table before it recalculates. I can be confident that those top rows used to have 0 values.