Generate Strings of Sequences of Natural Numbers from Start and End numbers
Problem description & analysis
In the Excel file below, column A and column B contain natural numbers that represent the start points and end points of sequences:
A |
B |
C |
D |
|
1 |
start |
end |
result |
|
2 |
1 |
10 |
||
3 |
9 |
3 |
||
4 |
2 |
8 |
We are trying to generate strings of sequences of natural numbers from column A and column B and populate the results to column D, as shown below:
A |
B |
C |
D |
|
1 |
start |
end |
result |
|
2 |
1 |
10 |
1,2,3,4,5,6,7,8,9,10 |
|
3 |
9 |
3 |
9,8,7,6,5,4,3 |
|
4 |
2 |
8 |
2,3,4,5,6,7,8 |
This computing scenario involves the basic uses of sequences.
Solution
Configure esProc add-in in Excel, restart the spreadsheet tool, and write formula =esproc("=to(?,?).concat@c()",A2,B2)in D2. You can also enclose the sequence with brackets: =esproc("=[to(?,?)]",A2,B2)
Then copy cell D2 or drag it down to cells below to complete the computation.
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/