Link to home
Start Free TrialLog in
Avatar of vipaman
vipamanFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Issues with 'If' statement - excel

Not sure my logic is correct with this, but I thought i would give it a go. I have used an IF OR statement and then on the true variable embedded an IF AND statement. Within the attached spreadsheet, cells D13 and D14 I check 1st for validity - in the example I have given, the values fall within the true range so should then calculate the exponential - this is not happening. In cell G16 I have checked what I believe the output should be for the below. Within the worksheet I have embedded an image of the calculations I am trying to automate. i decided to start with those circled in red with 1 and then check 2....

=IF(OR(D13<-1.5,D14>2),0,IF(AND(-1.5<=D13<=0,0<=D14<=2),D16*EXP(D17*D13),0))

Thanks in advance, Paul
co.xlsx
ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vipaman

ASKER

Excellent. Just done some validation checks - I understand your variables but don't understand how you can embed 4 variables. You have managed to remove the OR variable?
Now you have 2 cases:
1. AND: -1.5 <= D13 <=0, 0 < D14 <= 2          - calculate S
2. All other cases                                              - S = 0