1

I have a calculation where I need to iterate and action several times, as follows:

For a certain count, I need to multiply by 1.1 and floor, so that: (Assume A1 as base value, and B2 as repeat count)

If B2=3, I need:

=FLOOR(1.1 * FLOOR(1.1 * FLOOR(1.1 * A1 )))

Is there any way to make the multiplication and flooring occur the number of times indicate in B2 cell?

Note:

=FLOOR(A1 * (1.1^B2))

Will return bad output.

3

Yes, if you use a custom function. These are written in JavaScript, are a bit slower, and can do pretty much anything. Yours would look like:

function floorIt(base, times) {
  var total = Math.floor(base * 1.1)  //start with 'A1' * 1.1
  for (var i = 1; i < times; i++){ 
    total = Math.floor(total * 1.1);  //Multiply by 1.1 by ('B2'-1) times
}
 return total;
}
  • Thanks for the reply, I was hoping to find a solution without custom functions. If nothing comes up I'll mark this as best answer. :) – Selfish Feb 16 '17 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.