For this we use theUNIQUE function.

This is what makes this solution fully dynamic.

Video:What is an array?

Excel formula: Dynamic two-way count

Calculate unique averages

We now have what we need to calculate the averages.

The formula in G5 is:

The firstargumentin AVERAGEIFS isaverage_range.

This is the range that contains numbers to average.

Excel formula: Dynamic two-way sum

In this example, this is the Rating column in the table:

The other arguments arerange/criteriapairs.

If rows are deleted from the table, spill ranges contract as needed.

However, one drawback is that pivot tables need to be refreshed to show the latest data.

Excel UNIQUE function

Formulas, on the other hand, update instantly when data changes.

Excel TRANSPOSE function

Excel AVERAGEIFS function