18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Introducing Array Formulas 17<br />

FIGURE 17.11<br />

Multiplying each array element by itself.<br />

Using functions with an array<br />

As you may expect, you also can use functions with an array. The following array formula, which you can<br />

enter into a 10-cell vertical range, calculates the square root of each array element in the array constant:<br />

{=SQRT({1;2;3;4;5;6;7;8;9;10})}<br />

If the array is stored in a range, an array formula such as the one that follows returns the square root of each<br />

value in the range:<br />

{=SQRT(A1:A10)}<br />

Transposing an array<br />

When you transpose an array, you essentially convert rows to columns and columns to rows. In other<br />

words, you can convert a horizontal array to a vertical array (and vice versa). Use the TRANSPOSE function<br />

to transpose an array.<br />

Consider the following one-dimensional horizontal array constant:<br />

{1,2,3,4,5}<br />

You can enter this array into a vertical range of cells by using the TRANSPOSE function. To do so, select a<br />

range of five cells that occupy five rows and one column. Then enter the following formula and press<br />

Ctrl+Shift+Enter:<br />

=TRANSPOSE({1,2,3,4,5})<br />

The horizontal array is transposed, and the array elements appear in the vertical range.<br />

Transposing a two-dimensional array works in a similar manner. Figure 17.12 shows a two-dimensional<br />

array entered into a range normally and entered into a range by using the TRANSPOSE function. The formula<br />

in A1:D3 is<br />

{={1,2,3,4;5,6,7,8;9,10,11,12}}<br />

The formula in A6:C9 is<br />

{=TRANSPOSE({1,2,3,4;5,6,7,8;9,10,11,12})}<br />

325

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!