  The celebrated Expected Shortfall (ES) optimization formula implies that ES
at a fixed probability level is the minimum of a linear real function plus a
scaled mean excess function. We establish a reverse ES optimization formula,
which says that a mean excess function at any fixed threshold is the maximum of
an ES curve minus a linear function. Despite being a simple result, this
formula reveals elegant symmetries between the mean excess function and the ES
curve, as well as their optimizers. The reverse ES optimization formula is
closely related to the Fenchel-Legendre transforms, and our formulas are
generalized from ES to optimized certainty equivalents, a popular class of
convex risk measures. We analyze worst-case values of the mean excess function
under two popular settings of model uncertainty to illustrate the usefulness of
the reverse ES optimization formula, and this is further demonstrated with an
application using insurance datasets.
