We are currently doing a MS-Access to .Net web page project. In MS-Access VBA code they have used WorksheetFunction.Quartile function. Please let me know the equivalent function in C#.

Sample usage in VBA:

Q1 = WorksheetFunction.Quartile(arrY, 1)

View More Answer And Comment : Stackoverflow

## Top Answer 1

I dont know of any wrapped up nice little function like that, though would be very helpful. I recommend installing math.NET

http://www.mathdotnet.com/

Here shows all that is included in SortedArrayStatistics

http://numerics.mathdotnet.com/api/MathNet.Numerics.Statistics/SortedArrayStatistics.htm

below is a quartile example that I believe meets your needs

using System; using MathNet.Numerics.Statistics; class Test { static void Main() { double numbers = new double { 1, 2, 3, 4, 5 }; double a = SortedArrayStatistics.Minimum(numbers); double b = SortedArrayStatistics.LowerQuartile(numbers); double c = SortedArrayStatistics.Median(numbers); double d = SortedArrayStatistics.UpperQuartile(numbers); double e = SortedArrayStatistics.Maximum(numbers); Console.WriteLine({0}\n{1}\n{2}\n{3}\n{4}\n, a,b,c,d,e); } }output

1 1.66666666666667 3 4.33333333333333 5

## Top Answer 2

I dont know of any wrapped up nice little function like that, though would be very helpful. I recommend installing math.NET

http://www.mathdotnet.com/

Here shows all that is included in SortedArrayStatistics

http://numerics.mathdotnet.com/api/MathNet.Numerics.Statistics/SortedArrayStatistics.htm

below is a quartile example that I believe meets your needs

using System; using MathNet.Numerics.Statistics; class Test { static void Main() { double numbers = new double { 1, 2, 3, 4, 5 }; double a = SortedArrayStatistics.Minimum(numbers); double b = SortedArrayStatistics.LowerQuartile(numbers); double c = SortedArrayStatistics.Median(numbers); double d = SortedArrayStatistics.UpperQuartile(numbers); double e = SortedArrayStatistics.Maximum(numbers); Console.WriteLine({0}\n{1}\n{2}\n{3}\n{4}\n, a,b,c,d,e); } }output

1 1.66666666666667 3 4.33333333333333 5

View More Answer And Comment : Stackoverflow