Excel 2019 Bible

(singke) #1

Chapter 18: Understanding and Using Array Formulas


18


Naming Array Constants


You can create an array constant, give it a name, and then use this named array in a for-
mula. Technically, a named array is a named formula.


Chapter 4, “Working with Excel Ranges and Tables,” and Chapter 9, “Introducing Formulas and
Functions,” cover the topic of names and named formulas.

Figure 18.5 shows a named array being created from the New Name dialog box. (Access this
dialog box by choosing Formulas ➪ Defined Names ➪ Define Name.) The name of the array
is DayNames, and it refers to the following array constant:


{"Sun","Mon","Tue","Wed","Thu","Fri","Sat"}

FIGURE 18.5


Creating a named array constant


Notice that in the New Name dialog box, the array is defined (in the Refers To field) using
a leading equal sign (=). Without this equal sign, the array is interpreted as a text string
rather than an array. Also, you must type the curly brackets when defining a named array
constant; Excel doesn’t enter them for you.


After creating this named array, you can use it in a formula. Figure 18.6 shows a worksheet
that contains a multicell array formula entered into the range B2:H2. The formula is as
follows:


{=DayNames}
Free download pdf