Microsoft Office Tutorials and References
In Depth Information
Understanding the Dimensions of an Array
The following is another example of a vertical array; this one has four elements:
{“Widgets”;”Sprockets”;”Do-Dads”;”Thing-A-Majigs”}
To enter this array into a range, select four cells in a column, enter the following formula, and
then press Ctrl+Shift+Enter:
={“Widgets”;”Sprockets”;”Do-Dads”;”Thing-A-Majigs”}
Two-dimensional arrays
A two-dimensional array uses commas to separate its horizontal elements, and semicolons to
separate its vertical elements. The following example shows a 3 x 4 array constant:
{1,2,3,4;5,6,7,8;9,10,11,12}
To display this array in a range requires 12 cells. To enter this array into a range, select a range of
cells that consists of three rows and four columns. Then type the following formula, and press
Ctrl+Shift+Enter:
={1,2,3,4;5,6,7,8;9,10,11,12}
Figure 14-2 shows how this array appears when entered into a range (in this case, B3:E5).
Figure 14-2: A 3 x 4 array, entered into a range of cells.
If you enter an array into a range that has more cells than array elements, Excel displays #N/A in
the extra cells. Figure 14-3 shows a 3 x 4 array entered into a 10 x 5 cell range.
 
Search JabSto ::




Custom Search