# COLUMNS

#### Syntax

**COLUMNS**(*range*; *columnIndex1*; *columnIndex2*; …; *columnIndexN*)

* *range* - the range from which the columns should be extracted *- **Value type**: range*
* *columnIndex1-N* - the indicees of the columns which should be included in the return range - ***Value type**: number*

#### Remarks

* The order of the columns in the return range is the same as the order of the *columnIndex* parameters.
* If a column does not exist in *range*, a column with empty cells is included in the range.
* It is possible to use the same index multiple times, then the same column is included multiple times in the result range.

#### Examples

The left table is filled with the columns 1 and 3 of table1.

<figure><img src="https://3148043601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL43fiRbeRtPnTjMpbGNO%2Fuploads%2Fgit-blob-62d52b27f6486eb0f58f0582f2b409ac91ccfce7%2Fgrafik%20(100).png?alt=media" alt=""><figcaption></figcaption></figure>

The left table is filled with several columns of table2 in a custom order. Including an empty column, by using 0 as index.

<figure><img src="https://3148043601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL43fiRbeRtPnTjMpbGNO%2Fuploads%2Fgit-blob-760bf22c0fccde769899678da2e6bf3350a98fcd%2Fgrafik%20(353).png?alt=media" alt=""><figcaption></figcaption></figure>
