Excludes a specified number of rows or columns from the start or end of an array. You might find this function useful to remove headers and footers in an Excel report to return only the data.
Syntax
=DROP(array, rows,[columns])
The DROP function syntax has the following arguments:
-
array   The array from which to drop rows or columns.
-
rows   The number of rows to drop. A negative value drops from the end of the array.
-
columns The number of columns to exclude. A negative value drops from the end of the array.
Errors
-
Excel returns a #CALC! error to indicate an empty array when rows or columns is 0.
-
Excel returns a #NUM when array is too large.
Examples
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. If you need to, you can adjust the column widths to see all the data.
Remove the first 2 rows and return the last row of the array.
Data |
||
---|---|---|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
Formulas |
||
=DROP(A2:C4,2) |
Remove the first 2 columns and return the last column of the array.
Data |
||
---|---|---|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
Formulas |
||
=DROP(A2:C4,,2) |
Remove the last 2 rows and return the first row of the array.
Data |
||
---|---|---|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
Formulas |
||
=DROP(A2:C4,-2) |
Remove the first 2 columns and rows and return the remainder of the array.
Data |
||
---|---|---|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
Formulas |
||
=DROP(A2:C4,2,2) |