Excel SUMIFS with Dates
SUMIFS function is condition based function which is used to get the sum of the values of Range that meets the specified criteria. SUMIFS can be used to sum the value based on Texts, Dates, and Numbers that match the criteria specified by you. It allows you to pass one or more criteria.
SYNTAX: =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], [criteria_range3, criteria3],…)
Arguments of Syntax:
- SUM Range: Sum Range is the range of cells that you want evaluated based on specified criteria.
- Criteria_range1: criteria_range1 is the range of cells from where you would like to specify 1st criteria
- Criteria1: Criteria 1 is the 1st criteria that need to be specified from Criteria_range1.
- Criteria_range2: If you look at the syntax Criteria_range2 looks optional. It is the range of cells from where you would like to specify 2nd criteria
- Criteria2: Criteria 2 is the 2nd criteria that need to be specified from Criteria_range2.
SUMIF Vs SUMIFS
SUMIF and SUMIFS, both functions are condition based function and both functions used to sum the value in the range of cells based on specified criteria. So how are both different from each other? Here are some points.
- Sum_range in SUMIF function is an Optional argument. However, the sum_range in SUMIFS function is the required argument. If you don’t mention the sum_range in SUMIFS function than it will result in an error.
- SUMIF can be used with one condition only however, SUMIFS function can be used based on one or more than one condition.
- In the SUMIFS function, each criteria_range must have the same number of rows as used in the sum_range. However, there is no such mandatory rule in SUMIF function. See the example below.
See Above image: Criteria_range is E2:E51 and Sum Range is J36:J51. It gives the actual results.
See Above image: In 1st image, Criteria_range is E2:E51 and Sum Range are J36:J51. We used SUMIF function It gives the actual results. However, when we used SUMIFS with sum_range as J36:J51 and Criteria_range as E2:E51 it shows error (See Image 2).
Now we apply SUMIFS with sum_range as J2:J51 and Criteria_range as E2:E51 and we see that formula works. See below
Below is the sales data of a store. We have different fields like Order ID, Order Date, Customer, Postal Code, Region, Product ID, Category, Sub-Category, Product Name, Sales and Quantity.
Now let us get the Sum of Sales based on the different number of Criteria’s.
Examples of Excel SUMIFS with Dates
Let’s look below at some of the examples of Excel SUMIFS with Dates.
Suppose someone asks you “What is the total sales for Office Supplies in West Region”. Here we have two criteria: 1 – Office Supplies from “Category” 2 – West from “Region” Column.
You will use the SUMIFS function with Dates to get the total sales.
- Sum_range: Sum Range will be the sales column as you need to get the total sales.
- Criteria_range1: Criteria_range1 will be Range from the Category column
- Criteria1: Criteria1 is Office Supplies as criteria_range1 is Category Column that contains the criteria
- Criteria_range2: Criteria_range2 will be Range from Region column
- Criteria2: Criteria2 will be “West” as you need to get the sales for West region
Note: You can also use Category in criteria_range1 and Region in criteria_range2 however, criteria should be selected according to criteria_range.
The Actual formula will be =SUMIFS(J2:J51,G2:G51,”Office Supplies”,E2:E51,”West”)
The answer is 2762.64.
Question: What is the total sales value of the West region before 2017?
Solution: Apply formula =SUMIFS(J2:J51,E2:E51,”West”,B2:B51,”<1/1/2017″) and it will give you the total sales value of Orders before 1/1/2017 for West region.
The answer is 3695.2.
Question: What is the total sales value of Phone (Sub-Category) from the west region before 8/27/2017.
Solution: Here You need to get sales based on 3 conditions: – Sub-Category, Region and Order Date. Here you need to pass criteria_range3 and criteria3 as well.
Apply formula =SUMIFS(J2:J51,E2:E51,”West”,H2:H51,”Phones”,B2:B51,”< 8/27/2017″) and it will give you the total sales value of Phone (Sub-Category) from west region before 8/27/2017.
The answer is 966.14.
Question: What is the total sales value of orders placed in the year 2017.
Solution: You can see that here you need to get sales value of a given year however, you don’t have year fields in the data. You only have “Order Date” so you can pass two conditions, 1st – Order Date is greater than or equal to 1/1/2017 and 2nd condition – Order Date is less than or equal to 12/31/2017.
Here you need to apply the following SUMIFS formula for dates
As you can see that I have also passed logical Operator “=” hence this will include both the date.
The answer is 5796.2.
Question: Someone asks you to get the sales value for all those orders where we didn’t have a customer name who purchase our product.
Solution: You can see that there is a number of orders where the customer name is blank.
Here you need to apply the following SUMIFS formula for dates =SUMIFS(J2:J51,C2:C51,””)
“” means that this formula will calculate only those cells where there is no value in the customer name field. If you pass “ ” (space in between the inverted comma) then this will not give you proper results as space itself considered as a character.
The answer is 1864.86.
Question: Someone asks you to get the sales value for all those orders where the customer name is not blank.
Here you need to apply the following SUMIFS formula for dates =SUMIFS(J2:J51,C2:C51,”<>”)
Things to Remember
Here are some things to remember while applying the SUMIFS formula:
- While using SUMIFS function you need to make sure that each criteria_range contains the same number of rows that you have taken in sum_range.
- SUMIFS function follows AND logic only means all the criteria must meet the conditions given in the argument. If you need to pass the OR condition than you need to use SUMPRODUCT formula instead of SUMIFS.
- Make sure that the Sum range is in proper format which will allow you to do the calculation. If the Sum range format is text or Unicode than the function will not work properly.
This has been a guide to SUMIFS with Dates. Here we will learn how to sum values between two date range in Excel along with practical examples and downloadable excel template. You may learn more about excel from the following articles –
- SUMIF Not Blank
- How to Sum Multiple Rows in Excel?
- Excel SUM Shortcut
- SumIf with Multiple Criteria
- SUMIF With VLOOKUP
- 35+ Courses
- 120+ Hours of Videos
- Full Lifetime Access
- Certificate of Completion
- Basic Excel Training
- Advanced Excel Training
- Basic & Advanced VBA Course
- Excel Dashboard Course
- Data Analysis in Excel
- Create VBA Applications