DROP
Remove a set number of rows or columns from the start or end of an array with Excel's DROP function.
Spreadsheet editor
Spreadsheet editor
Syntax
=DROP(array, rows, [columns])
Returns: Array Arguments
| Argument | Required | Description |
|---|---|---|
| array | Yes | The range or array you want to trim rows or columns from. |
| rows | Yes | The number of rows to remove. A positive number drops from the top, and a negative number drops from the bottom. |
| columns | No | The number of columns to remove. A positive number drops from the left, and a negative number drops from the right. Leave it out to keep every column. |
About
Use positive numbers to drop from the top or left, and negative numbers to drop from the bottom or right. For example, dropping 1 row removes the first row, while dropping -1 row removes the last one. The columns argument is optional, so you can leave it out when you only need to trim rows. Because the result is a live spill, it updates automatically as your source data grows or shrinks.
DROP is the natural partner to TAKE, which keeps the edge rows and columns that DROP throws away. Combine it with FILTER to clean a list before slicing, or with VSTACK and HSTACK to reshape data first. To pick specific columns by position instead, reach for CHOOSECOLS.
Examples
Cut a totals row off the bottom
Spreadsheet editor
Dropping more rows than the list holds
Spreadsheet editor
Trim a row and a column at once
Spreadsheet editor
Watch out for
Dropping more than the array holds
Asking DROP to remove as many or more rows (or columns) than the array contains leaves nothing behind, so you get a #CALC! error.
→ Keep the rows and columns counts smaller than the size of the array. Use ROWS and COLUMNS to check how big your range is before you trim it.
Confusing drop with keep
People expect DROP(array, 3) to return 3 rows, but it removes 3 rows and returns everything else.
→ DROP cuts rows from the edge. If you want to keep a set number of rows instead, use TAKE.
Output blocked by existing data
DROP spills its result, so a value sitting in the output area triggers a #SPILL! error and nothing appears.
→ Clear the cells below and to the right of the formula so the trimmed array has empty space to expand into.