title: Excel Average of Data Between a Date
body: <p>I need to perform an excel task of doing [(cash + card + check) - part cost] and then finding the average between a certain set of dates to receive the average profit given a certain amount of time.  This should not be too difficult, as the on paper formula is easy and I believe dates in excel are numerical in value, but I cannot seem to figure it out.  Here's an image to better aid you in understanding:</p>
  
  <p><img src="https://i.stack.imgur.com/n0vGl.png" alt="enter image description here"></p>
  
  <p>As you can see on the left is a "Date" column located at column A.  And a bit to the right is this:</p>
  
  <p><img src="https://i.stack.imgur.com/yif6a.png" alt="enter image description here"></p>
  
  <p>All I need to do is, within a certain date range, add cash + card + check and subtract that total by the part cost column.  The issue is not being able to add all of the sums of the columns and subtract them by part cost, the issue is coming up with a formula that finds the average based on the number of rows between a certain set of dates, decided by the Week Start and Week End input box on column Q.</p>
  
  <p>I know I need to do something along the lines of =IF(A:A >= Q1 and A:A &lt;= Q2, AVERAGE((K:K + M:M + N:N)-H:H),0).  If you understand what I'm trying to get at, please assist me.</p>
  
  <p>Recap: All columns K, L, and M within an input date range need to be added together and subtracted by all column H values that are within the date range, and then I need the average of them.  So the average of (K + L + M) - H within a specified date range.</p>