Generate arithmatic sequence In case of string where interval is not 1

I have a formula like:

=ROW(A1) &" x "& ROW(A1) & " = " & ROW(A1)*ROW(A1)

It generates text like:

1 x 1 = 1
2 x 2 = 4
3 x 3 = 9
4 x 4 = 16
5 x 5 = 25
6 x 6 = 36
7 x 7 = 49
8 x 8 = 64
9 x 9 = 81

How to modify the formula so that it generate text like:

5 x 5 = 25
15 x 15 = 225
25 x 25 = 625
35 x 35 = 1225
45 x 45 = 2025
55 x 55 = 3025
65 x 65 = 4225

The progression of the numbers is like:

5*1
5*3
5*5
5*7

So, I need 1,3,5,7… where ROW(A1) gives 1,2,3,4…

What can i do here?

Use ROW()*2-1 for odd numbers.

2 Likes

Thank you very much. The final formula is:

=((ROW()*2-1)*5) &" x "& ((ROW()*2-1)*5) & " = " & ((ROW()*2-1)*5)*((ROW()*2-1)*5)

Why not:

row()*10-5
2 Likes

I would say, that often you prefer self-explaining code over maximal optimization. The first formula is self-explaining (with a mathematical definition of odd number sequence written explicitly), while the second is not so. And the overhead here is practically negligeable.

1 Like

may be… but if we describe the task as »start a sequence with 5 and increment by 10« it looks fine?!

1 Like