For this problem the final contract price needs to be calculated.
Let c be contract price = eg 100 i = interest (1% of c) g = another percentage (eg 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))
This can be solved in Excel using the iterative calculation option. Under Excel options > Formulas > Calculation Options, enable iterative calculations:
Before enabling iterative calculations you get the "Circular Reference" error:
After enabling iterative calculations, Excel will calculate:
Formula view to better see circularity:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.