Chapter 16: Introducing Array Formulas
363
array. Also, you must type the curly brackets when defining a named array constant; Excel does
not enter them for you.
After creating this named array, you can use it in a formula. Figure 16.6 shows a worksheet that
contains a single array formula entered into the range A1:G1. The formula is
{=DayNames}
FIGURE 16.5
Creating a named array constant.
FIGURE 16.6
Using a named array in an array formula.
Because commas separate the array elements, the array has a horizontal orientation. Use semico-
lons to create a vertical array. Or you can use the Excel TRANSPOSE function to insert a horizontal
array into a vertical range of cells (see “Transposing an array,” later in this chapter). The following
array formula, which is entered into a seven-cell vertical range, uses the TRANSPOSE function:
{=TRANSPOSE(DayNames)}
You also can access individual elements from the array by using the Excel INDEX function. The
following formula, for example, returns Wed, the fourth item in the DayNames array:
=INDEX(DayNames,4)