Syntax
=TOCOL(array, [ignore], [scan_by_column])Arguments
| Argument | Required | Description |
|---|---|---|
array | Required | The range or array |
ignore | Optional | 0 keep all (default), 1 skip blanks, 2 skip errors, 3 skip blanks and errors |
scan_by_column | Optional | FALSE (default) reads row by row, TRUE column by column |
How to use TOCOL
When TOCOL returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.
TOCOL takes 1 required argument and 2 optional arguments. Type =TOCOL( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=TOCOL({1,2;3,4})Result Spilled result
| A | |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
=TOCOL({1,2;3,4}, 0, TRUE)Result Spilled result
| A | |
|---|---|
| 1 | 1 |
| 2 | 3 |
| 3 | 2 |
| 4 | 4 |
Related array functions
- SORTSorts the rows or columns of a range or array.
- SORTBYSorts a range or array by the values of other ranges or arrays.
- SORTNReturns the first n rows of a range after sorting, with options for ties.
- TAKEReturns a number of rows or columns from the start (positive) or end (negative) of an array.
- TOROWReturns the values of an array as a single row.
- TRIMRANGERemoves empty rows and columns from the edges of a range.
- UNIQUEReturns the unique rows (or columns) of a range or array.
- VSTACKStacks arrays on top of each other; shorter rows are padded with #N/A.
- WRAPCOLSWraps a row or column of values into columns of the given length.