The result is 5,775, the sum of the first six values in the range C5:C16. Note: The TAKE function is new in Excel. See below for aj OFFSET formula that will work in older versions of Excel.

### TAKE function

The TAKE function returns a subset of a given array. The number of rows and columns to return is provided by separate rows and columns arguments. For example, you can use TAKE to return the first 3 rows or columns of an array like this: In this problem, the values we want to sum are in the range C5:C16, and the number of rows to return is a variable entered in cell E5. To return the first n values from C5:C16, we use TAKE like this: In this configuration, TAKE will return an array with six values like this: To sum these values, we simply need to nest the TAKE function inside the SUM function like this: The result is 5,775, the sum of the first six values in the range C5:C16.

### OFFSET function

In older versions of Excel that do not have the TAKE function, you can use the OFFSET function to solve this problem. OFFSET is designed to create a reference to a range constructed with five inputs: (1) a starting point, (2) a row offset, (3) a column offset, (4) a height in rows, (5) a width in columns. To sum the first 6 values in C5:C16, we can use the OFFSET function with the SUM function like this: Inside OFFSET, we use C5 for reference, since we want to start at C5. Next, we provide 0 for rows and 0 for cols since we don’t want a row offset or a column offset. Finally, we provide E5 for height, since this cell contains the number of rows to include in the sum. We don’t need to provide a value for the optional width argument, since width will be automatically inherited from reference. In this configuration, OFFSET will return a reference to C5:C10. The formula will evaluate like this: The final result is 5,775, the sum of the first six values in the range C5:C16.

### Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.