Monday, December 08, 2008

Excel Financial functions for .NET, implemented with F#

MSDN Code Gallery - Excel Financial functions for .NET

“What is it?
This is a .NET library that provides the full set of financial functions from Excel. The main goal for the library is compatibility with Excel, by providing the same functions, with the same behaviour. Note though that this is not a wrapper over the Excel library; the functions have been re-implemented in managed code so that you do not need to have Excel installed to use this library.

Where I can find documentation on these functions?
Just open Excel and click on Formulas/Financial or go to this link: http://office.microsoft.com/client/helppreview.aspx?AssetID=HP100791841033&ns=EXCEL&lcid=1033&CTT=3&Origin=HP100623561033

I don't think one of the function is right. Excel produces the wrong results! Why don't you do it right?
My goal is to replicate Excel results (right and wrong). Feel free to contribute to the effort by coding what you think is the right solution and I'll add an ExcelCompliant flag to the function to conditionally invoke your code.

How do I use the library?
Just add Financial.dll to the references in your project. The functions are provided as static methods on a Financial class in the System.Numeric namespace.

I see the library was implemented with F#. But I don’t want to redistribute F# along with my application. What should I do?
There are two versions of the library. One of them statically links the F# libraries so that there is no dependency on F#. However, this assembly larger, so if you have F# installed, you can use the FinancialNotStandalone.dll instead.

…”

I found this project interesting in a number of different ways;

  • Getting the Excel Financial functions in a .Net assembly is pretty darn cool
  • The fact it was written in F#
  • The source was included
  • There are 201,349 test cases
  • That F# can be statically linked (meaning you can use this assembly without having F# installed)

(via less than dot - Financial Functions for .NET released)

No comments: