monirg
Well-known Member
- Joined
- Jan 11, 2005
- Messages
- 629
Hello;
I would very much appreciate your help in constructing the following as an Excel w/s nested IF statement.
I'm using here variable names instead of reference cells for easy writing. THEN, ELSE, and ENDIF are used to identify (for you) each IF block. I'm also providing the conditions in their simplest form to avoid possible confusion!
Thank you.
I would very much appreciate your help in constructing the following as an Excel w/s nested IF statement.
I'm using here variable names instead of reference cells for easy writing. THEN, ELSE, and ENDIF are used to identify (for you) each IF block. I'm also providing the conditions in their simplest form to avoid possible confusion!
Code:
IF dir > 0.0 THEN
IF a2 < a1 THEN
IF (a1 - a2) < pi() THEN
th = th
ELSE
th = 2*pi() - th
END IF
ELSE
IF (a2 - a1) < pi() THEN
th = 2*pi() - th
ELSE
th = th
END IF
END IF
ELSE
IF a2 < a1 THEN
IF (a1 - a2) < pi() THEN
th = 2*pi() - th
ELSE
th = th
END IF
ELSE
IF (a2 - a1) < pi() THEN
th = th
ELSE
th = 2*pi() - th
END IF
END IF
END IF