I have the following:
set @SomeVariable = @AnotherVariable/isnull(@VariableEqualToZero,1) - 1
If @VariableEqualToZero is null it substitutes t
set @SomeVariable = @AnotherVariable / (case when isnull(@VariableEqualToZero, 0) = 0 then 1 else @VariableEqualToZero end) - 1