View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Conversion of numbers

Arne,

For a string in cell A2:

=VALUE(LEFT(A2,FIND("-",A2)-1))+VALUE(MID(A2,FIND("-",A2)+1,2))/32+IF((LEN(A2)-FIND("-",A2))=3,IF(MID(A2,FIND("-",A2)+3,1)="-",-1/64,IF(MID(A2,FIND("-",A2)+3,1)
= "+", 1/64,MID(A2,FIND("-",A2)+3,1)/256)))

I just wasn't sure how to interpret this:

"refers to the number of 124:s. Thus the price is 99 and 2/32 and 1/256."

Should it actually be divided by 124, or by 256 - I used 256 in the formula.

HTH,
Bernie
MS Excel MVP


"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!