Function Creation, mapping strike to options format

jb09

New Member
Joined
Dec 4, 2010
Messages
8
Hey all,

I have created a simple function called "test":

Function test(Ticker, year, month, dt, strike)
If Len(month) = 1 Then month = "0" & month
If Len(dt) = 1 Then month = "0" & month

test = Ticker & year & month & dt & "C" & strike & "U"

End Function

-------------------------------------------------------------------

I am having an issue with strike. Strike is looking in the spreadsheet to a column which has downloaded the strike price of the option. This may be listed as 8.00, 8.65, 80, 80.60, 86.50, 180.00, etc etc. The format that this needs to be in 00086000 if the strike was 86. For 86.50 strike it would be 00086500U; 186.00 = 00186000 etc etc. What i am trying to do is allow the function to identify the strike, and then output the desired format as listed earlier.

If you would need a spreadsheet attached to this I can post it as well, but this is essentially what I am trying to do. I appreciate any assistance and if i need to explain further i will!

Thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,224,578
Messages
6,179,654
Members
452,934
Latest member
mm1t1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top