LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Conversion of numbers

1) I will assume there are always 2 digits before the first hyphen
2) You state:"However if there are three decimals eg 99-021 the last digit
refers to the number of 124:s. Thus the price is 99 and 2/32 and 1/256." I
will assume this should be 1/124
With the coded value (and Oh what a code!) in A1
In B1 we get the dollar amount with =--LEFT(A1,2)
In C1 we get the 32-th bit with =MID(A1,4,2)/32
In D1 we get the 1/124 bit or the 1/64 correction with
=IF(ISNUMBER(--MID(A1,6,1)),RIGHT(A1)/124,IF(RIGHT(A1)="+",1/64,IF(RIGHT(A1)="-",-1/64,0)))
And in E1 we get the total with =SUM(B1:D1)
I recommend you test this with more examples
I will leave it to use to combine all of this into one simple formula if so
desired
And I expect others to give a us nice VBA solution
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Arne Hegefors" wrote in message
...
Hi! I have a list with prices of US Treasury bonds. They are quoted in a
partcular way that I would like to convert to decimal form. They are
quoted
like this eg: 99-02. Now this means that the price is 99 and some decimal.
The two first numbers are the number of 32:s. Thus in this case the price
is
99 and 2/32. However if there are three decimals eg 99-021 the last digit
refers to the number of 124:s. Thus the price is 99 and 2/32 and 1/256.
Sometimes There are only two decimals followed by a plus or minus sign eg
99-30+ or 99-10-. The plus/minus indicates that you should add/subtract
1/64.
Is there any way that I can convert these price quotes into decimal form
using worksheet functions? Any help very much appreciated! Thanks a lot in
advance!



 
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
Replace Old Part Numbers with New Part Numbers in a Macro. Jeffery Keown Excel Discussion (Misc queries) 5 October 17th 06 03:45 PM
conditional formatting Lofty Excel Worksheet Functions 7 July 10th 06 09:06 PM
How to generate sets of random numbers without having duplicates William Excel Worksheet Functions 1 June 6th 06 05:30 AM
Why are 1/2 my numbers imported as text and the rest as numbers? KBear Excel Discussion (Misc queries) 2 April 21st 06 01:40 PM
Conversion of Dec numbers to Bin, Oct and Hex and visa versa xzl6pl Excel Discussion (Misc queries) 1 June 27th 05 12:15 PM


All times are GMT +1. The time now is 02:37 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"