DROP Function¶
The DROP function in Excel is used to exclude a specified number of rows or columns from the beginning or end of an array or range. This function is the complement of TAKE, useful for removing header rows, trailing data, or creating subsets by exclusion.
Key Features of DROP:¶
- Excludes rows from the beginning or end of an array.
- Excludes columns from the left or right of an array.
- Can exclude both rows and columns simultaneously.
- Positive values drop from the start; negative values drop from the end.
- Works seamlessly with other dynamic array functions.
Syntax:¶
- array: The array or range from which to exclude rows and/or columns.
- rows: The number of rows to exclude. Positive values drop from the top; negative values drop from the bottom. Use 0 or omit to keep all rows.
- columns (optional): The number of columns to exclude. Positive values drop from the left; negative values drop from the right. If omitted, all columns are kept.
How DROP Works:¶
- If
rowsis positive,DROPremoves rows from the beginning of the array. - If
rowsis negative,DROPremoves rows from the end of the array. - If
columnsis positive,DROPremoves columns from the left side of the array. - If
columnsis negative,DROPremoves columns from the right side of the array. - If a value exceeds the array dimensions, all rows/columns are removed and an error is returned.
Examples:¶
1. Remove First 2 Rows (e.g., Header Rows):¶
Given a range A1:C10 with data:
Result:
2. Remove Last 3 Rows:¶
Result:
3. Remove First Row and First Column:¶
Result:
4. Remove Last 2 Rows and Last Column:¶
Result:
5. Remove All Rows but Keep Only Columns (Remove First 2 Columns):¶
Result:
6. Combine with SORT to Remove Top N After Sorting:¶
Result:
7. Drop from an Array Constant:¶
Result:
(Returns the array with the first row and first column removed)
8. Remove Header Row from Imported Data:¶
Result:
Notes:¶
DROPis available in Excel 365 and Excel 2021 or later versions.- If the absolute value of
rowsorcolumnsequals or exceeds the array dimensions, Excel returns a#CALC!error because no data remains. - Using 0 for
rowsorcolumns(or omitting them) keeps all rows or columns respectively. DROPreturns a#CALC!error if the array is empty.- This function pairs well with
TAKE, which keeps rows/columns instead of removing them.
Applications:¶
- Header Removal: Remove header rows from datasets before processing.
- Data Trimming: Exclude first or last records that may be incomplete.
- Nested Array Operations: Combine with TAKE to extract middle sections of data.
- Report Formatting: Remove summary rows or metadata from exports.
- Dynamic Data Cleanup: Automatically exclude unwanted portions of imported data.
Related Functions:¶
- TAKE: Extracts a specified number of rows or columns from an array (opposite of DROP).
- FILTER: Returns rows that meet specified criteria.
- SORT: Sorts an array by specified columns.
- INDEX: Returns a value or reference from a specific position in an array.
- CHOOSECOLS: Returns specified columns from an array.
- CHOOSEROWS: Returns specified rows from an array.
Tip: Combine
DROPwithTAKEto extract a middle section of data. For example,=TAKE(DROP(data, 2), 5)removes the first 2 rows and then takes the next 5 rows, effectively extracting rows 3-7 from the original data.