Using splits in the example on wikipedia, you could calculate the rank and then the grade:
New Table( "bell curve for exam grade calculation",
Add Rows( 16 ),
New Script(
"Distribution",
Distribution(
Continuous Distribution(
Column( :Result ),
Custom Quantiles( 0.95, [0.8, 0.5, 0.2, 0.1, 0] )
),
Nominal Distribution( Column( :Grade ) ),
SendToReport(
Dispatch( {"Result"}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {"Result"}, "Summary Statistics", OutlineBox, {Close( 1 )} ),
Dispatch(
{"Result", "Custom Quantiles"},
"Smoothed Empirical Likelihood Quantiles",
OutlineBox,
{Close( 1 )}
)
)
)
),
New Column( "Result",
Numeric, "Continuous", Format( "Best", 12 ),
Set Values(
[100, 101, 98, 82, 87, 100, 92, 67, 108, 97, 88, 80, 52, 73, 50, 57]
)
),
New Column( "Rank",
Numeric, "Continuous", Format( "Best", 12 ),
Formula( Col Rank( :Result, <<Tie( "minimum" ) ) )
),
New Column( "Rank PCT",
Numeric, "Continuous", Format( "Percent", 12, 0 ),
Formula( :Rank / N Rows() )
),
New Column( "Grade",
Character, "Nominal",
Formula(
If(
:Rank PCT >= 0.8, "A",
:Rank PCT >= 0.5, "B",
:Rank PCT >= 0.2, "C",
:Rank PCT >= 0.1, "D",
"F"
)
)
)
)
You could also just use Col Quantile() to find the cutoff points for each grade, or get them directly from the distribution platform using custom quantiles. See the saved script in the table above.