'How to calculate the percentage of the total, when the total includes the percentage -circular calculations

For this problem the final contract price needs to be calculated.

Let c be contract price = e.g. 100 i = interest (1% of c) g = another percentage (e.g. 1% of c)

The total contract price however, needs to be calculated using i and g of c + i + g. In other words the final value must include a total that calculates i and g (percentages) of the total of c+i+g. Is this even possible?

As we need to calculate i and g first, this seems impossible/circular.

I was trying to create something in python to simulate this but what we really want is a solution in excel.

Is anyone able to shed any light on such circular calculations which seem to depend on future values?

def totalcontractprice(c,i,g):
    x=c+i+g
    return x

def finalcontractprice(totalcontractprice):
    #here we want to return the finalcontract price
    #this should recalculate i and g as percentages of x (totalcontractprice)



c=100
i=1 #1 percent of c
g=1 #1 percent of c


print(totalcontractprice(c,i,g))


Solution 1:[1]

This can be solved in Excel using the iterative calculation option. Under Excel options > Formulas > Calculation Options, enable iterative calculations:

enter image description here

Before enabling iterative calculations you get the "Circular Reference" error:

enter image description here

After enabling iterative calculations, Excel will calculate :

enter image description here

Formula view to better see circularity:

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DKoontz