SLICE function

The SLICE function allows you to select a subset of values from an array.

Let's get started by watching the following videos!

Examples

The examples in this section use this data set.

 A B 1 Fruit Units 2 Apples 10 3 Oranges 15 4 Pears 20

Use the SLICE function to specify a subset of values

Formula

`SLICE ( A:A , 1 , 3 )`

Note: The SLICE function is zero based. Therefore, cell A1 is counted as a 0.

Result

`Apples, Oranges`

Formula

`SLICE ( A:A , start , end )`

Result

`Apples, Oranges, Pear`

Note: The SLICE function is useful in nested formulas with any of the math functions available, such as AVERAGE, SUM, or MIN/MAX/MEDIAN. SLICE will clean up the data selection so that the first value (column header) won't be included in the equation. If new cells are added the column, those cells will be automatically included in the formula.

Formula

`SLICE ( A:A, 2, -2)`

Note: This is useful for removing the top two and bottom two rows of your data source. For example, a header and blank row at the top of the data source and a blank row and totals row at the bottom of the data source.