Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default parsing complex numbers

can anyone think of an easy way to parse the real and
imaginary part of a complex number into two separate cells
in excel (using excel or VB)

2.111+0.34i = 2.111 0.34
-2.11-0.34i = -2.11 -0.34

i thought of cycling through the word using mid function
and checking for ascii values

thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default parsing complex numbers

=IMREAL(A1)
&
=IMAGINARY(A1)

HTH
Dana DeLouis


"levent" wrote in message
...
can anyone think of an easy way to parse the real and
imaginary part of a complex number into two separate cells
in excel (using excel or VB)

2.111+0.34i = 2.111 0.34
-2.11-0.34i = -2.11 -0.34

i thought of cycling through the word using mid function
and checking for ascii values

thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default parsing complex numbers

can anyone think of an easy way to parse the real and
imaginary part of a complex number into two separate cells
in excel (using excel or VB)

2.111+0.34i = 2.111 0.34
-2.11-0.34i = -2.11 -0.34

i thought of cycling through the word using mid function
and checking for ascii values


There are worksheet functions for this -- IMAGINARY and
IMREAL. You may need to check the Analysis ToolPak add-in
to use them.

HTH,
Merjet



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default parsing complex numbers

Try this

Call ExtractRI("string value in here")

Function ExtractRI(x As String)
r = Val(x)
i = Val(Right(x, Len(x) - Len(Str(Val(r)))))
End Function

Cheers
Nigel

"levent" wrote in message
...
can anyone think of an easy way to parse the real and
imaginary part of a complex number into two separate cells
in excel (using excel or VB)

2.111+0.34i = 2.111 0.34
-2.11-0.34i = -2.11 -0.34

i thought of cycling through the word using mid function
and checking for ascii values

thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default parsing complex numbers

yeah, i should have thought of that

thanks
-----Original Message-----
Try this

Call ExtractRI("string value in here")

Function ExtractRI(x As String)
r = Val(x)
i = Val(Right(x, Len(x) - Len(Str(Val(r)))))
End Function

Cheers
Nigel

"levent" wrote in

message
...
can anyone think of an easy way to parse the real and
imaginary part of a complex number into two separate

cells
in excel (using excel or VB)

2.111+0.34i = 2.111 0.34
-2.11-0.34i = -2.11 -0.34

i thought of cycling through the word using mid function
and checking for ascii values

thanks



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing Column of Numbers into 5 separate columns Dkline Excel Worksheet Functions 1 February 13th 09 03:15 PM
Parsing out text or numbers Clay Excel Worksheet Functions 2 April 24th 07 09:16 PM
VBA complex numbers Levent Excel Programming 1 July 22nd 04 03:46 PM
Complex Numbers No Name Excel Programming 1 June 24th 04 06:04 AM
Complex numbers Alain Turgeon Excel Programming 2 June 1st 04 09:19 PM


All times are GMT +1. The time now is 09:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"