Calculating Sum of Sales During Specific Period in Excel

How to calculate a sum in a period of time where dates are involved

One of our students asked this question on Facebook: I would like to know how to calculate a sum in a period of time where dates are involved. This interesting problem can be solved either using the DSUM function or Array formulas. The DSUM involves:

  1. Copying the headers to a location below the data leaving a space 3-4 rows
  2. Defining the condition or criteria under the labels or headers
  3. The headers and the conditions become the ‘criteria’ of the DSUM function
  4. For a range of dates you can copy the ‘dates’ header twice so that under the first header you define the start date and in the other ‘Dates’ header you define the End date as shown in the training video.

The use of the sum and if functions as an array are quite powerful and useful. Here you need to do the following:

  1. The data under the headers is selected and given a name. This data then becomes the named range. For example the data under the Dates header is selected and given the name ‘dates’ and the data under the ‘Values’ header is given the name ‘values’.
  2. Now you write the formula in any cell where you wish to get the result (E5 or E6): =sum(if((Month=(dates)=6), values,0)). Then press the 3 keys ctrl+shift+enter simultaneously from the keyboard to get the result for June. In case you don’t do this correctly you’ll get the result ‘#value’!

Watch the video below to see how to use the dsum and array formulas to solve the problem:

Leave a Reply

Your email address will not be published. Required fields are marked *