You need to sign in to do that
Don't have an account?
kaulsaksoft
Loops in Formulae Field
Hi
how to do "FOR" loop kind of functions in Formula Fields?
I need to execute the For
Sum from Y= 1 to Y=80 of { (1+400/100)**RATE}
Has anyone done the same in Salesforce without Apex Code
You can not use LOOPS in formulas. You could use s-controls, though.
To calculate the sum of all integers between 1 and n you can use the mathemetical formula: n(n+1)/2.
If this is your theorethical FOR LOOP:
Y = 80
result =0
FOR (rate = 1 to Y) {
result = result + (1+400/100)*rate)
}
(1+400/100) = 5, btw.
Then the formula
(Y(Y+1)/2)*5 will give you your result.
Is that what you were looking for?