Need help creating a composite calculation with conditional logic and multiple variables