Formula should read D38 = (B29*((B31-G34))**2)/2Values in Cell B29, B31, G34 > 0Regarding If then loopI mean If range("D38").value <> 0 then ?Etc.