Perluas array dengan menambahkan baris atau kolom
=EXPAND(array, [rows], [columns], [pad_with])
| Parameter | Deskripsi |
|---|---|
array |
The array to expand. |
rows |
[optional] The final number of rows. Default is total rows. |
columns |
[optional] The final number of columns. Default is total columns. |
pad_with |
[optional] Value to use for new cells. Default is #N/A. |
To expand an array to be 5 rows by 4 columns, you can use EXPAND like this:
=EXPAND(array,5,4) // expand to 5 x 4
By default, any new cells created will be filled with #N/A errors. To expand an array to be 10 rows by 3 columns, and fill new cells with "x":
=EXPAND(array,10,3,"x") // expand to 10 x 3, fill with "x"
In the example below, we are adding 2 rows to an existing array with 5 rows. The result is an array with 7 rows. The formula in F3 is:
=EXPAND(B3:D7,7) // default padding
Notice that by default, EXPAND fills the new empty cells with the #N/A error. In the screen, the formula in F3 has been modified to provide zero (0) f
=EXPAND(B3:D7,7,,0) // pad with 0