Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Counting down formula

How do I write a formula to calculate how many iterations it will take to
reduce a number by a given percentage until that result is less than 1.

Example, how many iterations will it take to reduce 100 by 0.1% until the
value is less than 1

100, 99.9, 98.001, ..... 0.99999

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Counting down formula

Jake submitted this idea :
How do I write a formula to calculate how many iterations it will take to
reduce a number by a given percentage until that result is less than 1.

Example, how many iterations will it take to reduce 100 by 0.1% until the
value is less than 1

100, 99.9, 98.001, ..... 0.99999

Thanks


Using a VBA function, it takes 4,603 iterations to reduce 100 by 0.1%
until the remainder is less than 1. Here's my take on your posted
results:

99.9, 99.8001, 99.7002999 ..., 0.9999867159327194

Function GetNumOfIterations(ByVal Number As Double, _
ReduceBy As Double) As Long
Do
Number = (Number - (Number * ReduceBy))
GetNumOfIterations = GetNumOfIterations + 1
Loop Until Number < 1
End Function

To use the function in a worksheet, copy it to a standard module in the
workbook where it's to be used, and enter the following formula in the
cell you want the result:

=GetNumOfIterations(100,0.1%)

The formula can be used on any sheet within the workbook.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Counting down formula

On Mar 10, 7:07*pm, "Jake" wrote:
how many iterations will it take to reduce 100 by 0.1%
until the value is less than 1


=ROUNDUP(NPER(-0.1%,0,-100,1),0)

There is a very small chance that that will reduce exactly to 1
instead of less one. If you are concerned, you could do the
following:

=ROUNDUP(NPER(-0.1%,0,-100,1),0)
+(FV(-0.1%,ROUNDUP(NPER(-0.1%,0,-100,1),0),0,-100)=1)
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Counting down formula


"Jake" wrote in message
...
How do I write a formula to calculate how many iterations it will take to
reduce a number by a given percentage until that result is less than 1.

Example, how many iterations will it take to reduce 100 by 0.1% until the
value is less than 1

100, 99.9, 98.001, ..... 0.99999

Thanks


Thanks guys, that works for me.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting formula lawhawg Excel Worksheet Functions 1 March 20th 10 03:15 AM
Counting Formula Karen Smith Excel Discussion (Misc queries) 3 October 26th 07 10:06 PM
Formula / Counting Anna Excel Worksheet Functions 5 July 12th 07 02:38 PM
formula for counting TMF in MN Excel Worksheet Functions 7 October 31st 06 11:48 PM
Help with counting formula Ian Excel Discussion (Misc queries) 1 January 7th 05 10:25 AM


All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"