View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Treasury Bond Pricing conversion

Good point. Your TEXT function call to limit the entry to 3 digits is the
way to go. Thanks for noting the problem with my formula.

--
Rick (MVP - Excel)


"JoeU2004" wrote in message
...
"Rick Rothstein" wrote:
=INT(C1)&"-"&320*MOD(C1,1)


Test with 110-160 minus 99-159. I believe the desired result is 1-001.
Ostensibly, your formula will result in 1-1. But it actually results in
11-0.999999999999091.


----- original message -----

"Rick Rothstein" wrote in message
...
Assuming your decimal value is in C1, this will convert it back to the
format you showed...

=INT(C1)&"-"&320*MOD(C1,1)

--
Rick (MVP - Excel)


"pakeez" wrote in message
...

As you may know that T-Bonds price format is xxx-xxx (e.g 110-16 which
is equivalent to 110 16/32 or 99-245 which is equivalent to 99
24.5/32)

Now I need to do some calaculaltions while trading Bonds and I want to
do in excel 03.

I was given a hint that I need to convert the above price format first
in decimal value and then format the result in xxx-xxx.

e.g 110-16 is in cell A1 then formula for converting to decimal would
be:
=Left(A1,3)+Right(A1,3)/320

Since I have been out of touch with excel for long time I am having
hard time how to format back in xxx-xxx.

So I am giving an example below to do calculations to do price
difference:

say cell A1 has value of 110-160
say cell B1 has value of 99-245

The answer is 10-235.

Now how can I get this calculations done in excel. Detail formulas
would be appreciated.

Thank YOu


--
pakeez
------------------------------------------------------------------------
pakeez's Profile:
http://www.thecodecage.com/forumz/member.php?userid=278
View this thread:
http://www.thecodecage.com/forumz/sh...ad.php?t=92522