Sun 13 Mar 2016

Solution - Challenge 36 – Generate Triangular Numbers

By |Sunday, March 13th, 2016|Categories: Solutions|Tags: , , , , , , |0 Comments

Below is a possible solution to Challenge 36 – Generate Triangular Numbers.

Enter below formula anywhere and drag down -

=IF(ROWS($1:1)=1,1,INDIRECT(ADDRESS(ROW()-1,COLUMN()))+ROWS(($1:1)))

A workbook containing the above solution can be downloaded from Solution - Challenge 36 – Generate Triangular Numbers.

Edit - 23-Aug-16 - A better solution is to use below formula and drag down

=ROWS($1:1)*(ROWS($1:1)+1)/2

Sat 13 Feb 2016

Challenge 36 - Generate Triangular Numbers

By |Saturday, February 13th, 2016|Categories: Challenges|Tags: , , , , , , |1 Comment

If interested in details about Triangular Numbers, you can refer to following link (though it is not needed and one look at the sequence, you will understand what it is)

https://en.wikipedia.org/wiki/Triangular_number

It is, basically, the following sequence -

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406

The challenge is to write a formula which can be put down in any cell and which when dragged down will generate the above sequence.

Hence, if I put the formula in say A1, it should generate the above sequence. Same formula if put in C4 and dragged down, should generate the above sequence. Same formula if put in F8 and dragged down, should generate the above sequence. Hence, the formula should not require any tweaking to generate the sequence in different columns. Same formula should work in any cell.

The solution to the above challenge will be published after a month i.e. on 13-Mar-16.