1

Let's say I have a 2x2 array in Excel/Google Sheets:

={1,2;3,4}

To add on additional rows to this array -- for example, to make it 4x2, I can use ;:

enter image description here

However, how could additional columns be added on, for example, to make the array 2x4, something like:

enter image description here

7
  • Mind you, this won't work in Excel Commented Dec 28, 2020 at 9:05
  • @JvdV how could that be done in Excel? Or it's not possible to combine a range with an array literal? Commented Dec 28, 2020 at 9:06
  • It won't be pretty, but if you want to output it like you have, one way is =CHOOSE({1;2;3;4},B5:B6,C5:C6,{5,7},{6,8}) Commented Dec 28, 2020 at 9:13
  • @JvdV -- neat. How does {1;2;3;4} work as the index_num though? Commented Dec 28, 2020 at 9:19
  • 1
    Because I assumed you have access to dynamic-arrays using Excel 365, we can feed CHOOSE() an array. In this case a horizontal array, and it will return us all 4 parameters behind it which are vertical arrays. I hope that is clear =). But I think you can just stick to GoogleSheets if you want a user-friendly approach like you have =) Commented Dec 28, 2020 at 9:23

2 Answers 2

3

Arrays allow nesting in Google Sheets so you can try something like:

={B5:C6, {5,6;7,8}}

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

A very valuable answer.
1

In Google Sheets you can use the following 2 formulas

=SEQUENCE(4,2)

={SEQUENCE(2,2),SEQUENCE(2,2,5)}

enter image description here

Functions used:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.