Forum Discussion
anupambit1797
Feb 28, 2023Iron Contributor
COMPLEX & ROUND
Dear Experts, Attached is the calculator , where I need a simpler formula.. rather than:- =COMPLEX(ROUND(IF(ABS(IMREAL(D24))<$L$22,0,IF(ABS(1-IMREAL(D24))<$L$22,1, IF(ABS(1...
dscheikey
Mar 04, 2023Bronze Contributor
Just a small optimisation: You can use IFS() instead of the nested IF() statements.
=
COMPLEX(
ROUND(
IFS(
ABS(IMREAL(D24))<$L$22,
0,
ABS(1-IMREAL(D24))<$L$22,
1,
ABS(1+IMREAL(D24))<$L$22,
-1,
TRUE,
IMREAL(D24)
),
$AB$1),
ROUND(
IFS(
ABS(IMAGINARY(D24))<$L$22,
0,
ABS(1-IMAGINARY(D24))<$L$22,
1,
ABS(1+IMAGINARY(D24))<$L$22,
-1,
TRUE,
IMAGINARY(D24)
),
$AB$1),
"j")