4,374 questions
Your code does not correctly match the left and right paren.
Correcting the code to what I assume is the correct code would look like below.
let
D4= 0.035,
D5= 0.05,
D6= 0.07,
E4= 1,
E5= 0.9,
E6= 0.8,
Result =
if (
(1-
(1-
(if [#"% CR"]<=D4
then
1
else
if [#"% CR"]<=D5
then
(1-
([#"% CR"]-D4)
/
((D5-D4)/(E4-E5))
)
else
if [#"% CR"]<=D6
then
(E5-
([#"% CR"]-D5)
/
((D6-D5)/(E5-E6))
)
else
0
)*2
)
) =-1
)
then
0
else
(1-
(1-
(if [#"% CR"]<=D4
then
E4
else
if [#"% CR"]<=D5
then
(E4 -
([#"% CR"]-D4)
/
((D5-D4)/(E4-E5))
)
else
if [#"% CR"]<=D6
then
E5-
([#"% CR"]-D5)
/
((D6-D5)/(E5-E6))
else 0
)*2
)
)
in
Result