Hi there,
The code below calculates the efficiency of a system. Both if statements return 0 if rc[-3] is 0. The first if statement returns 1 if the efficiency is calculated to be greater than 1. The second statement returns all values less than 1.
My question is, how can I modify it so that, if the value returned is less than 0 then return 1?
Thank you
The code below calculates the efficiency of a system. Both if statements return 0 if rc[-3] is 0. The first if statement returns 1 if the efficiency is calculated to be greater than 1. The second statement returns all values less than 1.
My question is, how can I modify it so that, if the value returned is less than 0 then return 1?
Code:
Range("AJ2:AJ" & Lastrow).FormulaR1C1 = "= If(If(rc[-3] = 0, 0,(rc[-6] * rc[-5]) / ((rc[-6] * rc[-5]) + (" & kesscond & " * rc[-6]^2)))>1,1,If(rc[-3] = 0, 0,(rc[-6] * rc[-5]) / ((rc[-6] * rc[-5]) + (" & kesscond & " * rc[-6]^2))))"
Thank you