Is there a C# library that will perform the Excel NORMINV function?

calendar_today Asked May 25, 2010
thumb_up 7 upvotes
history Updated April 16, 2026

Question posted 2010 · +9 upvotes

I’m running some Monte Carlo simulations and making extensive use of the Excel function NORM.INV using Office Interrop. This functions takes three arguments (probability, average, standard deviation) and returns the inverse of the cumulative distribution.

I’d like to move my code into a web app, but that will require installing Excel on the server. Does anybody know of a C# statistics library that has an equivalent function to NORM.INV?

Accepted answer +7 upvotes

Meta.Numerics has exactly what you are looking for. Here is the code to do it using that library:

Distribution n = new NormalDistribution(mean, standardDeviation);
double x = n.InverseLeftProbability(probability);

If you are doing this in order to generate normal deviates, the GetRandomValue function is even faster.

Top excel Q&A (6)

+7 upvotes ranks this answer #122 out of 167 excel solutions on this site .