By stats writer / November 5, 2023
Table of Contents
When working with large datasets in Excel, it can be useful to select every nth row. This can be done by using the OFFSET function, which takes a range as an argument and returns a reference to a range that is offset from the original range. To select every nth row, the OFFSET function is used in combination with the ROW function to create a dynamic range that is incremented by n for each row. An example would be: OFFSET(A1,(ROW()-1)*n,0). This formula will select every nth row starting from the first row.
You can use the following basic formula to select every nth row in Excel:
=OFFSET($A$1,(ROW()-1)*n,0)
This formula selects every nth row.
Simply change the value for n in the formula to select specific rows.
For example, you can use the following formula to select every 3rd row:
=OFFSET($A$1,(ROW()-1)*3,0)
The following examples show how to use this formula in practice.
Example: Select Every Nth Row in Excel
Suppose we have the following list of values in Excel:
We can use the following formula to select every third row from the list:
=OFFSET($A$1,(ROW()-1)*3,0)
We will type this formula into cell C1 and then copy and paste it to the remaining cells in column C:
Notice that every third row has been selected from the list of original values:
If we change the value of n in the formula, we can select a different nth value.
=OFFSET($A$1,(ROW()-1)*5,0)
We will type this formula into cell C1 and then copy and paste it to the remaining cells in column C:
Notice that every fifth row has been selected from the list of original values:
Related terms:
- Average Every Nth Row in Excel (With Example)
- How to Sum Every Nth Row in Excel (With Examples)
- How do I Sum Every Nth Row in Google Sheets (With Examples)
- Randomly Select a Winner in Excel How to randomly select a winner in excel
- SAS: Use SELECT DISTINCT in PROC SQL what is the procedure to use SELECT DISTINCT in PROC SQL?
- VBA: Find Last Used Row, What is the last row of my data set?
- How do you compare two dataframes row by row?
- How can I select the first row by group using dplyr?
- Excel: Move Every Other Row to Column
- How do you delete every third row in Excel?