Forum Discussion

angelohafner's avatar
angelohafner
Copper Contributor
Mar 31, 2020

complex numbers in format a+j*b, not in standard form a+b*j

Hi everyone!

 

Long time, I would like to work with complex numbers in Microsoft Excel.
I have a problem that I think here I can find one of the few people in the world capable of solving.

If I type in a cell the complex number (string) 3 + j4.  Is it possible to get only the imaginary part or just the real part to appear in another cell? (Can be using VBA)...

I advance that I need the form 3 + j4, which is not the standard of Excel.

Thanks in advance...

2 Replies

  • Savia's avatar
    Savia
    Iron Contributor

    angelohafner How Excel wants you to do this is to enter your imaginary number using =COMPLEX(3, 4).  Then you can extract the real or imaginary elements using =IMREAL and =IMAGINARY.  You can also use the large number of functions beginning =IM to do other kinds of imaginary number manipulation - addition, multiplication, and so on.

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    if your imaginary number is in cell A2 this gets the real part:
    =LEFT(A2,FIND("+",A2)-1)
    and this gets the imaginary part:
    =SUBSTITUTE(MID(A2,FIND("+",A2)+1,LEN(A2)),"j","")

Resources