The result is a range that includes the N cells to average.

In the example, F4 contains 3, so the row number is 10-(3-1) = 8.

With a row number of 8, INDEX returns C12.

Excel formula: Count table rows

The AVERAGE function then returns the average of C12:C14, which is $78.33.

you’re free to use INDEX to retrieve individual values, or entire rows and columns.

ROWS Function

The Excel ROWS function returns the count of rows in a given reference.

Excel formula: SUMIFS with Excel Table

Introduction to structured references

Formulas to query a table

Excel INDEX function

Excel AVERAGE function

Excel ROWS function

Article image

Article image