which_min function

Index of the Minimum/Maximum Value, with Correction for Ties