MDIFF function

Compute multidimensional difficulty index