This custom function generates triangular distribution with a specified minimum, maximum and mean.
Function TRIDIST(random As Double, min As Double, max As Double, mean As Double)
If mean < min Or max < mean Then
TRIDIST = CVErr(xlErrValue)
Else
If random <= (mean - min) / (max - min) Then
TRIDIST = min + Sqr((max - min) * (mean - min) * random)
Else
TRIDIST = max - Sqr((max - min) * (max - mean) * (1 - random))
End If
End If
End Function