brunces
10-11-2005, 09:22 AM
Friends,
Hi! How are you all? http://vbaexpress.com/forum/images/smilies/001.gif
Please, I need some function (or whatever) to do the following...
I have a random number in cell A1. In cell B1 I want that number plus its previous integer number, plus its previous, plus its previous, etc... until it hits 1.
Example:
If A1 = 5, B1 = 5 + 4 + 3 + 2 + 1.
If A1 = 10, B1 = 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1.
If A1 = 15, B1 = 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1.
And so on...
The function must work with any number in cell A1, even if it's a huge number (Ex.: 8,691,542). The number typed in A1 will always be integer.
Please, does anybody know if there's a function in Excel which can do such a thing? If not, is it possible to create such function (or whatever), using VBA?
That would be something like the FACT (factorial) function, but using sum, not multiplication.
I hope you can help me. http://vbaexpress.com/forum/images/smilies/001.gif
Thank you all for your attention, guys. http://vbaexpress.com/forum/images/smilies/001.gif
Hugs,
Bruno
Hi! How are you all? http://vbaexpress.com/forum/images/smilies/001.gif
Please, I need some function (or whatever) to do the following...
I have a random number in cell A1. In cell B1 I want that number plus its previous integer number, plus its previous, plus its previous, etc... until it hits 1.
Example:
If A1 = 5, B1 = 5 + 4 + 3 + 2 + 1.
If A1 = 10, B1 = 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1.
If A1 = 15, B1 = 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1.
And so on...
The function must work with any number in cell A1, even if it's a huge number (Ex.: 8,691,542). The number typed in A1 will always be integer.
Please, does anybody know if there's a function in Excel which can do such a thing? If not, is it possible to create such function (or whatever), using VBA?
That would be something like the FACT (factorial) function, but using sum, not multiplication.
I hope you can help me. http://vbaexpress.com/forum/images/smilies/001.gif
Thank you all for your attention, guys. http://vbaexpress.com/forum/images/smilies/001.gif
Hugs,
Bruno