Create every combination (Calc)

Hi, I’m trying to find a way to create a list of two numbers x, and y which will contain every combination of the numbers I have defined for x and y.
i.e. I’ve said x can be 1,2,3 Y can be 6,7,8 not actual numbers.
How can I create two columns one for x, one for y which look like so:

x      y
1      6
1      7
1      8
2      6
2      7
2      8
3      6
3      7
3      8

Any thoughts on how to go about this, I’ve a feeling it’s got something to do with matrix functions but don’t know.

I can only think of an ugly solution right now.

You can get started with a column of numbers, 1,2,3,4, et cetera.

Next you can try out the mod function. =mod(a1,3) will get you halfway to your y column.

You can then try out using the round function. =round(a1/3) will get you halfway to your x column.

A little tweaking from there and you should have it.