friedman
friedman

Reputation: 685

How to declare a two-dimensional array by one cell formula?

In Excel it is pretty simple, for example ={1,2,3,4;5,6,7,8} gives us 2 rows in 4 columns. But when I try similar in Google Spreadsheet, it fails.

EDIT: See comments below where the language version issue was revealed.

Upvotes: 0

Views: 2846

Answers (1)

Gary's Student
Gary's Student

Reputation: 96773

Nearly the same syntax, but different entry methods:

Excel

Hi-light a block of cells and array enter:

={1,2,3,4,5,6,7,8}

enter image description here

Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.

Google Sheets

Select a single cell and enter:

={1,2,3,4,5,6,7,8}

and the extension to the other cells occurs automatically:

enter image description here

Same is true for 2-D arrays:

enter image description here

If you are using Google Sheets, remember to leave enough empty cells to the right and below to hold the result.

Upvotes: 2

Related Questions