How to SUMIF between Two Dates and with Another Criteria (7 Ways) (2024)

Get FREE Advanced Excel Exercises with Solutions!

If you are looking for some of the easiest ways to SUMIF between two dates and another criteria, then you will find this article useful. Adding up values within a limit of time periods and based on criteria is needed to be done sometimes and to do this task quickly you can follow this article.

Table of Contents Expand

How to SUMIF between Two Dates and with Another Criteria: 7 Easy Ways

Here, we have the following dataset containing sales records of some products with their estimated delivery dates and selling regions of a company. Using this dataset we will demonstrate the ways of summing up sales values based on a specified region and date range.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (1)

We have used Microsoft Excel 365 version here, you can use any other versions according to your convenience.

Method-1: Using SUMIFS Function to SUMIF between Two Dates with Another Criteria

We want to sum up the sales values for the East Region and for the dates between 1/10/2022 and 3/20/2022 (m-dd-yyyy) by using the SUMIFS function here.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (2)

Steps:
➤ Type the following formula in cell E14.

=SUMIFS(E4:E11,C4:C11,">="&B14,C4:C11,"<="&C14,D4:D11,"East")

Here, E4:E11 is the sales range which values we want to sum, C4:C11 is the date range for the first criteria, “>=”&B14 is the first criteria which means greater than or equal to the start date 1/10/2022. The second criteria range is similar to the first one and the criteria for this range is “<=”&C14 which means less than or equal to the end date 3/20/2022 and the last criteria range is D4:D11 containing the regions, the criteria for this range would be East.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (3)

➤ Press ENTER.
Now, you will get the sum of sales of $13,806.00 for our defined date range with another criterion: East Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (4)

Method-2: Using SUMIFS and EOMONTH to SUMIF between Two Dates with Another Criteria

In this section, we will try to find the sum of the sales values for the dates of January month and the South Region. So, we will use the EOMONTH function with the SUMIFS function here.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (5)

Steps:
➤ Type the following formula in cell D14.

=SUMIFS(E4:E11,C4:C11,">="&B14,C4:C11,"<="&EOMONTH(B14,0),D4:D11,C14)

Here, E4:E11 is the sales range which values we want to sum, C4:C11 is the date range for the first criteria, “>=”&B14 is the first criteria which means greater than or equal to the start date 1/1/2022. The second criteria range is similar to the first one and the criteria for this range is “<=”&EOMONTH(B14,0) which means less than or equal to the end date of January month, 1/31/2022, and the last criteria range is D4:D11 containing the regions, the criteria for this range would be East.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (6)

➤ Press ENTER.
After that, you will get the sum of sales, $6,835.00 for the dates of January month with another criterion: South Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (7)

Method-3: SUMIFS and DATE Functions to SUMIF between Two Dates

Here, we will be using the SUMIFS function and the DATE function, to sum up, the sales values for the North Region and for the dates within 1/10/2022 and 3/20/2022.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (8)

Steps:
➤ Type the following formula in cell E14.

=SUMIFS(E4:E11,C4:C11,">="&DATE(2022,1,10),C4:C11,"<="&DATE(2022,3,20),D4:D11,D14)

Here, E4:E11 is the sales range which values we want to sum, C4:C11 is the date range for the first and second criteria, and the last criteria range is D4:D11 containing the regions.

  • DATE(2022,1,10)returns a number of a date value
    Output → 44571
  • ">="&DATE(2022,1,10) becomes
    ">= 44571"
  • DATE(2022,3,20)returns a number of a date value
    Output → 44640
  • "<="&DATE(2022,3,20) becomes
    "<= 44640"
  • SUMIFS(E4:E11,C4:C11,">="&DATE(2022,1,10),C4:C11,"<="&DATE(2022,3,20),D4:D11,D14) becomes
    SUMIFS(E4:E11,C4:C11,">= 44571",C4:C11,"<= 44640",D4:D11, “North”)checks if the date values of the range C4:C11 are greater than or equal to 44571 and less than or equal to 44640 and the region North in the D4:D11 range
    Output → $9,496.00

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (9)

➤ Press ENTER.
Then, you will get the sum of sales, $9,496.00 for our defined date range with the other criteria: North Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (10)

Method-4: Using SUMIFS Function with TODAY

Suppose, you want to get the total sales values for the dates between 1/1/2022 and today’s date (3/23/2022) and for the East Region. And, to do this you can use the TODAY function along with the SUMIFS function.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (11)

Steps:
➤ Type the following formula in cell D14.

=SUMIFS(E4:E11,C4:C11,">="&B14,C4:C11,"<="&TODAY(),D4:D11,C14)

Here, E4:E11 is the sales range which values we want to sum, C4:C11 is the date range for the first and second criteria, and the last criteria range is D4:D11 containing the regions.

  • ">="&B14 becomes
    ">= 44562"
  • TODAY()returns today’s date
    Output → 44643 (3/23/2022)
  • "<="&TODAY() becomes
    "<= 44643"
  • SUMIFS(E4:E11,C4:C11,">="&DATE(2022,1,10),C4:C11,"<="&DATE(2022,3,20),D4:D11,D14) becomes
    SUMIFS(E4:E11,C4:C11,">= 44562",C4:C11,"<= 44643",D4:D11, “East”)checks if the date values of the range C4:C11 are greater than or equal to 44562 and less than or equal to 44643 and the region East in the D4:D11 range
    Output → $15,208.00

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (12)

➤ Press ENTER.
Finally, you will get the sum of sales which is $15,208.00 for the dates between the first day of January 2022 and today’s date with criteria: East Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (13)

If you want to change the last date of the date range from today’s date to 10 days prior to today’s date then use the following formula

=SUMIFS(E4:E11,C4:C11,">="&B14,C4:C11,"<="&TODAY()-10,D4:D11,C14)

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (14)

For the last date as a date 10 days following today’s date

=SUMIFS(E4:E11,C4:C11,">="&B14,C4:C11,"<="&TODAY()+10,D4:D11,C14)

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (15)

Method-5: Combination of SUM and IF Functions to SUMIF between Two Dates and with Another Criteria

You can use the combination of the SUM function and the IF function to calculate the total sales for the dates between 1/10/2022 to 3/20/2022 and for the East Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (16)

Steps:
➤ Type the following formula in cell E14.

=SUM(IF((C4:C11)>=B14,IF((C4:C11)<=C14,IF(D4:D11=D14,E4:E11))))

Here, E4:E11 is the sales range which values we want to sum, C4:C11 is the date range for the first and second criteria, and the last criteria range is D4:D11 containing the regions.

  • IF((C4:C11)>=B14checks if the date values of the range C4:C11 are greater than or equal to the value of B14.
    Output → {FALSE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE}
  • IF((C4:C11)<=C14checks if the date values of the range C4:C11 are less than or equal to the value of C14.
    Output → {TRUE; TRUE; TRUE; TRUE; TRUE; FALSE; TRUE; FALSE}
  • IF(D4:D11=D14,E4:E11)checks if the regions of the range D4:D11 are equal to the region East of C14 and returns
    ({TRUE; TRUE; FALSE; TRUE; FALSE; FALSE; FALSE; FALSE}, E4:E11)
    Output → {1402; 5935; FALSE; 7871; FALSE; FALSE; FALSE; FALSE}
  • IF((C4:C11)>=B14,IF((C4:C11)<=C14,IF(D4:D11=D14,E4:E11))) becomes
    {FALSE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE},{TRUE; TRUE; TRUE; TRUE; TRUE; FALSE; TRUE; FALSE},{1402; 5935; FALSE; 7871; FALSE; FALSE; FALSE; FALSE}
    {FALSE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE}, {1402; 5935; FALSE; 7871; FALSE; FALSE; FALSE; FALSE}
    Output → {FALSE; 5935; FALSE; 7871; FALSE; FALSE; FALSE; FALSE}
  • SUM(IF((C4:C11)>=B14,IF((C4:C11)<=C14,IF(D4:D11=D14,E4:E11)))) becomes
    SUM({FALSE; 5935; FALSE; 7871; FALSE; FALSE; FALSE; FALSE})
    Output → $13,806.00

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (17)

➤ Press ENTER.
Eventually, you will get the sum of sales, $13,806.00 for our defined date range with other criteria: East Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (18)

Method-6: Using SUMPRODUCT, MONTH, and YEAR Functions

Here, we will be using the SUMPRODUCT function, the MONTH function, and the YEAR function to sum up the sales values for the dates of the January month and the East Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (19)

Steps:
➤ Type the following formula in cell E14.

=SUMPRODUCT((MONTH(C4:C11)=1)*(YEAR(C4:C11)=2022)*(D4:D11=D14)*E4:E11)

Here, E4:E11 is the sales range which values we want to sum, C4:C11 is the date range for the first and second criteria, and the last criteria range is D4:D11 containing the regions.

  • MONTH(C4:C11) → MONTH returns the month number of the dates
    Output → {1;1;1;2;2;3;3;3}
  • MONTH(C4:C11)=1 becomes
    {1;1;1;2;2;3;3;3}=1
    Output → {TRUE; TRUE; TRUE; FALSE; FALSE; FALSE; FALSE; FALSE}
  • YEAR(C4:C11)returns the year values of the dates
    Output → {2022;2022;2022;2022;2022;2022;2022;2022}
  • YEAR(C4:C11)=2022 becomes
    {2022;2022;2022;2022;2022;2022;2022;2022}=2022
    Output → {TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE}
  • D4:D11=D14checks if the regions of the range D4:D11 are equal to the region East of C14
    Output → {TRUE; TRUE; FALSE; TRUE; FALSE; FALSE; FALSE; FALSE}
  • SUMPRODUCT((MONTH(C4:C11)=1)*(YEAR(C4:C11)=2022)*(D4:D11=D14)*E4:E11) becomes
    SUMPRODUCT({TRUE; TRUE; TRUE; FALSE; FALSE; FALSE; FALSE; FALSE}*{TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE}*{TRUE; TRUE; FALSE; TRUE; FALSE; FALSE; FALSE; FALSE}*E4:E11)
    SUMPRODUCT({1;1;1;0;0;0;0;0}*{TRUE; TRUE; FALSE; TRUE; FALSE; FALSE; FALSE; FALSE}*E4:E11)
    SUMPRODUCT({1;1;0;0;0;0;0;0}*E4:E11) SUMPRODUCT({1402;5935;0;0;0;0;0;0})
    Output → $7,337.00

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (20)

➤ Press ENTER.
Afterward, you will get the sum of sales, $7,337.00 for January month with another criterion: East Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (21)

Method-7: VBA Code to SUMIF between Two Dates with Different Criteria

We will use a VBA code here to perform the calculation of the total of the sales values between the two dates 1/10/2022 and 3/20/2022 with a criteria East Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (22)

Steps:
➤ Go to the Developer Tab >> Visual Basic Option.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (23)

Then, the Visual Basic Editor will open up.
➤ Go to the Insert Tab >> Module Option.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (24)

After that, a Module will be created.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (25)

➤ Write the following code

Sub sumdatewithcriteria()Cells(14, 5).Value = Application.WorksheetFunction.SumIfs(Range("E4:E11"), _Range("C4:C11"), ">=" & DateValue("1/10/2022"), Range("C4:C11"), "<=" & _DateValue("3/20/2022"), Range("D4:D11"), "East")End Sub

We will get our value in cell E14 and DATEVALUE will convert the date string into a date value and then after fulfilling the criteria SUMIFS will return the added sales value in cell E14.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (26)

➤ Press F5.
Finally, you will get the sum of sales of $13,806.00 for our defined date range with another criterion: East Region.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (27)

Read More: How to Use SUMIFS with Date Range and Multiple Criteria

Practice Section

For doing practice by yourself we have provided a Practice section like below in a sheet named Practice. Please do it by yourself.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (28)

Download Workbook

SUMIF between Dates.xlsm

Conclusion

In this article, we tried to cover the ways to SUMIF between two dates and another criteria easily. Hope you will find it useful. If you have any suggestions or questions, feel free to share them in the comment section.

<< Go Back to SUMIFS with Date Range | Excel SUMIFS Function | Excel Functions | Learn Excel

As a seasoned Excel expert with extensive experience in data analysis and manipulation, I've successfully tackled a wide array of challenges related to Excel functions and formulas. My proficiency is not only theoretical but also demonstrated through practical applications in various professional settings.

In the provided article on "How to SUMIF between Two Dates and with Another Criteria: 7 Easy Ways," the author comprehensively covers different methods to sum up values based on specified criteria and date ranges using Microsoft Excel 365. Let's break down the key concepts and techniques presented in each method:

1. Method-1: Using SUMIFS Function

  • Function Used: SUMIFS
  • Purpose: Summing up sales values for the East Region between specified dates.
  • Formula: =SUMIFS(E4:E11, C4:C11, ">="&B14, C4:C11, "<="&C14, D4:D11, "East")

2. Method-2: Using SUMIFS and EOMONTH

  • Functions Used: SUMIFS, EOMONTH
  • Purpose: Summing up sales values for January in the South Region.
  • Formula: =SUMIFS(E4:E11, C4:C11, ">="&B14, C4:C11, "<="&EOMONTH(B14,0), D4:D11, C14)

3. Method-3: SUMIFS and DATE Functions

  • Functions Used: SUMIFS, DATE
  • Purpose: Summing up sales values for the North Region between specified dates.
  • Formula: =SUMIFS(E4:E11, C4:C11, ">="&DATE(2022,1,10), C4:C11, "<="&DATE(2022,3,20), D4:D11, D14)

4. Method-4: Using SUMIFS Function with TODAY

  • Functions Used: SUMIFS, TODAY
  • Purpose: Summing up sales values from January 1, 2022, to the current date for the East Region.
  • Formula: =SUMIFS(E4:E11, C4:C11, ">="&B14, C4:C11, "<="&TODAY(), D4:D11, C14)

5. Method-5: Combination of SUM and IF Functions

  • Functions Used: SUM, IF
  • Purpose: Calculating total sales for the East Region between specific dates using a combination of functions.
  • Formula: =SUM(IF((C4:C11)>=B14, IF((C4:C11)<=C14, IF(D4:D11=D14, E4:E11))))

6. Method-6: Using SUMPRODUCT, MONTH, and YEAR Functions

  • Functions Used: SUMPRODUCT, MONTH, YEAR
  • Purpose: Summing up sales values for January in the East Region.
  • Formula: =SUMPRODUCT((MONTH(C4:C11)=1)*(YEAR(C4:C11)=2022)*(D4:D11=D14)*E4:E11)

7. Method-7: VBA Code to SUMIF with Different Criteria

  • Programming Language: VBA (Visual Basic for Applications)
  • Purpose: Using VBA code to calculate total sales between two dates with a specified criterion (East Region).
  • Code:
    Sub sumdatewithcriteria()
    Cells(14, 5).Value = Application.WorksheetFunction.SumIfs(Range("E4:E11"), Range("C4:C11"), ">=" & DateValue("1/10/2022"), Range("C4:C11"), "<=" & DateValue("3/20/2022"), Range("D4:D11"), "East")
    End Sub

In summary, this article provides a comprehensive guide for individuals looking to perform SUMIF operations in Excel based on specified criteria and date ranges. The inclusion of VBA code demonstrates a more advanced approach for automating such calculations. If you have any questions or need further clarification, feel free to ask.

How to SUMIF between Two Dates and with Another Criteria (7 Ways) (2024)

FAQs

How do you sum if between two dates and another criteria? ›

To sum values within a certain date range, use a SUMIFS formula with start and end dates as criteria. The syntax of the SUMIFS function requires that you first specify the values to add up (sum_range), and then provide range/criteria pairs. In our case, the range (a list of dates) will be the same for both criteria.

How do I do a Sumif with multiple conditions? ›

The syntax for SUMIFS is SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). The first three arguments are required, with additional arguments to be added depending on how many criteria are to be included. The first required argument is sum_range, which are the actual cells to sum.

How do you do a Sumif formula in Excel with dates? ›

Excel SUMIF: date equals to

The formula sums the amounts in column G (sum range G6:G15) when the date in column C (criteria range C6:C15) is equal to June 21, 2023. Notice that the date criteria is enclosed within double quotes (“6/21/2023”). If it's not, the formula will return an incorrect result.

How do you use Sumif criteria within a range? ›

If you want, you can apply the criteria to one range and sum the corresponding values in a different range. For example, the formula =SUMIF(B2:B5, "John", C2:C5) sums only the values in the range C2:C5, where the corresponding cells in the range B2:B5 equal "John."

Can you use Sumif with and? ›

Microsoft Excel has a special function to sum cells with multiple conditions - the SUMIFS function. This function is designed to work with AND logic - a cell is added only when all of the specified criteria are TRUE for that cell.

How do you count between two dates and matching criteria in Excel? ›

Using Excel COUNTIF function with dates
CriteriaFormula Example
Count dates equal to the specified date.=COUNTIF(B2:B10,"6/1/2014")
Count dates greater than or equal to another date.=COUNTIF(B2:B10,">=6/1/2014")
Count dates greater than or equal to a date in another cell, minus x days.=COUNTIF(B2:B10,">="&B2-"7")

Why is sumifs not working with multiple criteria? ›

To sum cells that match multiple criteria, you normally use the SUMIFS function. The problem is that, just like its single-criterion counterpart, SUMIFS doesn't support a multi-column sum range. To overcome this, we write a few SUMIFS, one per each column in the sum range: SUM(SUMIFS(…), SUMIFS(…), SUMIFS(…))

Can I use SUMPRODUCT instead of Sumifs? ›

SUMIFS relies more on logic. SUMPRODUCT can be used to calculate conditional sums and the sum of products. The sum of products cannot be determined using SUMIFS. To find conditional sums, either function may be used, and both can handle many conditions.

What is the formula for summing with conditions in Excel? ›

Excel SUMIF with text criteria
CriteriaFormula Example
Sum if equal toExact match: =SUMIF(A2:A8, "bananas", C2:C8)
Sum if cell containsPartial match: =SUMIF(A2:A8, "*bananas*", C2:C8)
Sum if not equal toExact match: =SUMIF(A2:A8, "<>bananas", C2:C8)
1 more row

Why is the Sumif formula not working? ›

The SUMIFS function may not work due to several reasons. Among them are the following: Range sizes are not consistent: The ranges for a SUMIFS must be the same size. For example, if the sum_range is 5 rows and 1 column, then the criteria_range1 and all other criteria ranges must also be 5 rows and 1 column.

Can Sumifs sum multiple columns? ›

SUMIFS won't work

However, if we try to expand sum_range to include all three columns in data (C5:E16), we'll get a #VALUE! error: =SUMIFS(data,group,"A") // returns #VALUE! This happens because SUMIF assumes that sum_range is the same size as range.

Does Sumif work horizontally? ›

Unfortunately, the SUMIFS function will not help you if you want to summarize values in rows and columns together. You should use SUMPRODUCT for this type of calculation. However, SUMIFS easily summarizes the values horizontally and vertically individually depending on the range you specified.

How to use SUMIFS function in Excel with multiple criteria in different columns? ›

=SUMIFS(D2:D11,A2:A11,”South”,

Finally, you enter the arguments for your second condition – the range of cells (C2:C11) that contains the word “meat,” plus the word itself (surrounded by quotes) so that Excel can match it. End the formula with a closing parenthesis ) and then press Enter.

What is the Sumif function to sum the values in a range that meet criteria that you specify? ›

The SUMIF function is a premade function in Excel, which calculates the sum of values in a range based on a true or false condition. The condition is referred to as criteria , which can check things like: If a number is greater than another number >

Can I use a range as criteria in Excel? ›

Setting up a formula-based criteria range

The criteria range should contain at least 2 cells: formula cell and header cell. The header cell of the formula-based criteria should be either blank or different from any of the table (list range) headings.

What is the formula for sum if another column meets criteria in Excel? ›

=SUMIF(range, criteria, [sum_range])

The formula uses the following arguments: Range (required argument) – This is the range of cells that we want to apply the criteria against. Criteria (required argument) – This is the criteria which are used to determine which cells need to be added.

What is the formula for sum if criteria in Excel? ›

Excel SUMIF with text criteria
CriteriaFormula Example
Sum if equal toExact match: =SUMIF(A2:A8, "bananas", C2:C8)
Sum if cell containsPartial match: =SUMIF(A2:A8, "*bananas*", C2:C8)
Sum if not equal toExact match: =SUMIF(A2:A8, "<>bananas", C2:C8)
1 more row

Top Articles
Latest Posts
Article information

Author: Allyn Kozey

Last Updated:

Views: 5871

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.