Welcome to the forums. What you need is a tutorial on creating custom Excel functions. This might help:

http://www.vertex42.com/ExcelArticle...functions.html