Use isnan. Make formula dependent on delta nad not just the expected value.