How to find maximum value in excel with condition. How to find smallest value in array using a criteria.