top of page

Excel Arena

This is the place, where we can test the boundaries of Excel functions.

3 Types of Sequences in Excel, Power Query and Python in Excel

Sequence of Numbers Based on Given Number of Digit:


Input Digit - 2

Result - Generate sequence of numbers from 10 to 99.



Excel:

=LET(n,A2,s,10^(n-1),SEQUENCE(10^n-s,,s))


Power Query:

let

 n = 2,

 Result = {Number.Power(10, n-1)..Number.Power(10, n) - 1}

in

 Result


Python in Excel:

n = xl("A2")

[i for i in range(10 (n-1), 10 n)]


Sequence of Numbers 1; 2; 2; 3; 3; 3;4; 4; 4; 4:



Excel:

=LET(n,A2,s,SEQUENCE(n),TOCOL(IFS(s>=TOROW(s),s),3))


Python in Excel:

n = xl("A2")

L = [[i for x in range(1,i+1)] for i in range(1,n+1)]

sum(L, [])


Power Query:

let

 n = 4,

 Result = List.TransformMany({0..n}, (x) => {1..x}, (x,y) => x)

in

 Result


Triangular Number Series for Given N:


N = 7


Excel:

=LET(n,A2,s,SEQUENCE(n),s*(s+1)/2)


Power Query:

let N = 7,

Result = Table.FromList(List.Transform({1..N}, each ( + 1)/2 ), each {_}, {"Result"})

in

Result


Python in Excel:

N = xl("A2")

[i (i + 1)/2 for i in range(1,N + 1)]

Comments


  • LinkedIn
  • Facebook
  • Twitter
  • Instagram
bottom of page