I have two long formulas that I am trying to turn into a UDF because I use them frequently, and I am new to VBA.
The first formula converts the tick price (Agency MBS convention) into a decimal number. The convention is shown below.
ticktodec.PNG
For 104-084, the "08" to the right of "-" represents 8/32's and the third number represents 4/8 of 1/32 or alternatively 4/256. The "+" means half of 1/32 or 4/256 as well.
I created a UDF for this formula(=Pxd(n)), but it only works for 2 of the 4 different tick formats I need.
I tried to create a UDF for the second formula, which reverses the formula and converts decimals to ticks but kept running into errors.
dectotick.PNG
How do I fix the first UDF and how should I set up the UDF for the second formula? Thank you in advance for any help you can provide.
Bookmarks