SEQUENCE function in opposite order

wigi

Well-known Member
Joined
Jul 10, 2006
Messages
7,964
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Hello all,

The SEQUENCE function is new in Excel. It can be very useful, certainly when we use it as input in other functions. (MrExcel has a cheap e-book on the topic of the new dynamic array functions)

Now my question: SEQUENCE generates a sequence of numbers row by row, and on every row, column by column.
Does anyone know how to generate the series in the opposite direction: first all rows of the first column, then all rows of the second column, and so on.

Thanks a lot !

Wigi
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Is this what you mean?
If not could you clarify with a specific example?

20 05 16.xlsm
FGHIJ
1123
2456
3789
4101112
5131415
6
7
81471013
92581114
103691215
SEQ
Cell Formulas
RangeFormula
F1:H5F1=SEQUENCE(5,3)
F8:J10F8=TRANSPOSE(SEQUENCE(5,3))
Dynamic array formulas.
 
Upvote 0
Thanks Peter, I forgot about Transpose !
Though an additional parameter might be useful too, I guess, since SORT can do that too.
 
Upvote 0
Peter, I was confused, apologies. I thought about Transpose but the range should have the same dimensions. Please have a look at the attached image.
 

Attachments

  • 02.png
    02.png
    9.3 KB · Views: 22
Upvote 0
新建Microsoft Excel 工作表.xlsx
ABCDE
1500501500510
2502503501511
3504505502512
4506507503513
5508509504514
6510511505515
7512513506516
8514515507517
9516517508518
10518519509519
Sheet1
Cell Formulas
RangeFormula
A1:B10A1=SEQUENCE(10,2,500)
D1:E10D1=SMALL(SEQUENCE(10,2,500),ROW(1:10)+{0,10})
Dynamic array formulas.
 
Upvote 0
@wigi
I assume that the example in post #4 of what you wanted is a typo?
The original sequence is 500-519 but your transformation is 501-520 :confused:


I would modify shaowu459's suggestion to that shown in columns G:H ...

20 05 16.xlsm
ABCDEFGH
1500501500510500510
2502503501511501511
3504505502512502512
4506507503513503513
5508509504514504514
6510511505515505515
7512513506516506516
8514515507517507517
9516517508518508518
10518519509519509519
SEQ (2)
Cell Formulas
RangeFormula
A1:B10A1=SEQUENCE(10,2,500)
D1:E10D1=SMALL(SEQUENCE(10,2,500),ROW(1:10)+{0,10})
G1:H10G1=SMALL(SEQUENCE(10,2,500),SEQUENCE(10)+{0,10})
Dynamic array formulas.


.. the reason being that it is then doesn't fail if rows are inserted above
20 05 16.xlsm
ABCDEFGH
1
2
3500501502512500510
4502503503513501511
5504505504514502512
6506507505515503513
7508509506516504514
8510511507517505515
9512513508518506516
10514515509519507517
11516517510#NUM!508518
12518519511#NUM!509519
SEQ (2)
 
Last edited:
Upvote 0
Thank you all. Yes there was a typo, my bad.

I hope that Microsoft adds a 5th, optional, argument such that we can do it in a more elegant way with only SEQUENCE. Your formula solutions are nice though !
 
Upvote 0
I replaced {0,10} with a 3rd SEQUENCE function, since then I can make the number 10 dynamic too.
=SEQUENCE( 1, 2, 0, 10 ) and 10 becomes a cell reference.
In my application that number is based on other parameters.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top