Explanation

In this example, we havedatesin B5:B16 andsalesin C5:C16.

Both ranges arenamed ranges.

We then use a formula in F8 tosumthe dynamic range, and a formula in F9 tocountthe dynamic range.

Excel formula: Dynamic named range with INDEX

In the current version of Excel, this problem can be easily solved with the XLOOKUP function.

In older versions of Excel without XLOOKUP, it’s possible for you to use INDEX and MATCH.

Both approaches are described below.

Excel XLOOKUP function

The range operator (:) is used to construct ranges.

Nevertheless, the reference is there and can be used in other ways.

The SUM then returns a new result.

Excel INDEX function

Tocountresults instead of summing results, just replace the SUM function with the COUNT function.

Notice the range operator (:) sits between two separate INDEX and MATCH formulas.

The SUM function then returns a new result.

Excel MATCH function

XLOOKUP supports approximate and exact matching, wildcards (* ?)

you might use INDEX to retrieve individual values, or entire rows and columns.

MATCH supports approximate and exact matching, andwildcards(* ?)

Excel COUNT function

Numbers include negative numbers, percentages, dates, times, fractions, and formulas that return numbers.

Article image

Article image