IF statement problem with IMAGINARY

R

Russ

Hi: I have a cell, B31, that contains an imaginary number (69.2 +
39.4i). I want to do the following using the IF function (psuedo code
below):

IF IMREAL(B31) = 0

TRUE Then evaluate to "ATAN(IMAGINARY(B31) / 0.0000001"

FALSE Then evaluate to "ATAN(IMAGINARY(B31)/IMREAL(B31))"

The TRUE part works properly and evaluates to a number. The FALSE part
doesn't work and just puts the text "ATAN(IMAGINARY(B31)/IMREAL(B31))"
in the cell.

What am I doing wrong?

thanks,
russ
 
B

bj

get rid of the quotes the equation thinks you want text.
=IF(IMREAL(B31)=0,ATAN(IMAGINARY(B31)/0.000001),ATAN(IMAGINARY(B31)/IMREAL(B31)))
 
R

Russ

Here is the solution. When I use the function wizard to enter the
equation the result is this:

=IF(IMREAL(B31)=0,ATAN(IMAGINARY(B31)/0.000001),"ATAN(IMAGINARY(B31)/IMREAL(­B31)))"

When I take out the quotes like bj suggested (by directly editing the
cell formula) it works.

Looks like a bug in the function wizard. Agree?

thanks,
russ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top