First, you're using the wrong type for monetary value, see the problem . And What is the correct way to use float, double, and decimal types? .
Read everything on the linked page ? There it shows how to configure Excel and shows that after turning on the cyclic reference break you also have to say how many iterations you want it to be performed. That is, it has established a termination condition for repeating calls, so the code has to deal with this. Is that what you want? I did an example, I would do it better, but I did not want to change too much what you are trying to do.
using static System.Console;
public class Program {
public static void Main() {
var x = new Exemplo();
WriteLine(x.CalculaLucro());
}
}
public class Exemplo {
private decimal calculaDoacao(int iteracao, decimal valor) => 0.03M * calculaLucro(iteracao, valor);
private decimal calculaLucro(int iteracao, decimal valor) {
if (iteracao++ == 100) return valor;
return valor - calculaDoacao(iteracao, valor);
}
public decimal CalculaDoacao() => calculaDoacao(0, 10000M);
public decimal CalculaLucro() => calculaLucro(0, 10000M);
}
See running on .NET Fiddle . And no Coding Ground . Also I placed GitHub for future reference .
At some point the number of interactions does not change the useful end result. That is, with 100 or 10 the value after 2 or 4 decimal places, as we usually use in monetary values, the value gives the same. In this case with 5 seems to already give.