REMOVEROWS
Description
Removes one or more rows from the referenced area. The function removes the
number_of_rows
following
start_row
,
starting at and including
start_row
. Use REMOVEROWS without
specifying any rows in order to remove the first (heading) row.
Syntax
REMOVEROWS(
[range]
,
[number_of_rows]
,
[start_row]
)
- range: The matrix to remove the rows from.
- number_of_rows: The number of rows to remove. Use a value greater than 0 to removestart_rowand subsequent rows. Use a value less than 0 to removestart_rowand previous rows.
- start_row: The starting row to remove. You can setstart_rowto -1 to start removing rows from the bottom of the matrix instead of the top.
Example
The examples are based on this workbook:
A | B | C | D | E | |
|---|---|---|---|---|---|
1 | Item | 2014 | 2015 | 2016 | 2017 |
2 | 100 | 6452 | 6557 | 6772 | 6457 |
3 | 200 | 3458 | 3568 | 4668 | 3455 |
4 | 300 | 6791 | 6552 | 5382 | 6235 |
5 | 400 | 3524 | 6592 | 3562 | 3899 |
6 | 500 | 6458 | 3112 | 2855 | 3298 |
The result of
=REMOVEROWS(A1:E6,3,2)
is shown in this
table:
A
| B
| C
| D
| E
| |
1 | Item | 2014 | 2015 | 2016 | 2017 |
2 | 400 | 3524 | 6592 | 3562 | 3899 |
3 | 500 | 6458 | 3112 | 2855 | 3298 |
The result of
=REMOVEROWS(A1:E6,-4,-1)
is shown in this
table:
A
| B
| C
| D
| E
| |
1 | Item | 2014 | 2015 | 2016 | 2017 |
2 | 100 | 6452 | 6557 | 6772 | 6457 |
The result of
=REMOVEROWS(A1:E6)
is shown in this table
(headings are removed):
A | B | C | D | E | |
|---|---|---|---|---|---|
1 | 100 | 6452 | 6557 | 6772 | 6457 |
2 | 200 | 3458 | 3568 | 4668 | 3455 |
3 | 300 | 6791 | 6552 | 5382 | 6235 |
4 | 400 | 3524 | 6592 | 3562 | 3899 |
5 | 500 | 6458 | 3112 | 2855 | 3298 |
Notes
- In the results, formatting from the original cells is not preserved.
- This function is intended for use in array formulas.
Related Functions
ARRAYAREA
MERGEROWS