title: Using MIN IF function to find peaks and valleys in data
body: <p>I have a cyclic data set. There are low cycles and high cycles, each with slightly different mins and maxes. i need to find the values of each min and max. I have attached picture of a simplified version of what I have. I know roughly what time the peak/valley will occur, so i thought i could use the min if function to isolate each extreme value. For example, it i wanted to find a valley between time 1 and time 5, i would use this formula: </p>
  
  <p>=MIN(IF(1&lt; time&lt;5,data))</p>
  
  <p>This just yields 0 for some reason. It sort of worked once but instead of isolating the minimum for the selected time period, it just found the minimum for the whole column. What am I doing wrong here? Is what i am trying to do possible without using VBA? This is a template for work that others will use and not everyone is able to use macro-enabled workbooks so I'd like to avoid that.</p>
  
  <p><a href="https://i.stack.imgur.com/R5DmZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R5DmZ.png" alt="Simplified Example"></a></p>