How to Sum If Date Is Between in Excel
Learn multiple Excel methods to sum if date is between with step-by-step examples and practical applications.
How to Sum If Date Is Between in Excel
Why This Task Matters in Excel
Tracking totals for a defined period is one of the most common analytics questions in any organization. Sales managers want to know revenue generated between the start and end of a promotion, finance teams need to sum expenses for a fiscal quarter, and project leads must monitor hours logged within a sprint window. In each case the key requirement is identical: add up the numbers only when a related date falls inside a specified range.
Excel is a natural home for this analysis because most operational data eventually ends up in a spreadsheet: raw exports from ERP systems, CSV downloads from cloud apps, or manually curated logs. Whether you maintain a small table of invoices or a million-row data dump, Excel provides efficient, flexible ways to interrogate that data without moving it into complicated BI tools.
Knowing how to “sum if date is between” unlocks rapid answers to questions such as:
- How much did we spend on marketing between 15 March and 30 April?
- What is the total overtime worked this payroll period?
- Which supplier invoices dated in the last 7 days still need payment?
If you cannot isolate totals by date, you risk poor budgeting, inaccurate forecasting, and missed compliance deadlines. Worse, you might attempt manual filtering and copy-pasting totals, a process that is error-prone and impossible to audit. Mastering a proper formulaic approach saves hours, improves data integrity, and feeds directly into dashboards, charts, or Power Query models.
The good news is that Excel offers more than one route to success. Functions such as SUMIFS, SUMPRODUCT, DSUM and even PivotTables can all answer the same question. Choosing the right method depends on dataset size, version compatibility, and the degree of flexibility you need in your model. This tutorial shows you how to build solid, reusable solutions for any scenario.
Best Excel Approach
In modern Excel, the go-to solution is the SUMIFS function. Introduced in Excel 2007, SUMIFS extends the older SUMIF by supporting multiple criteria. Most importantly, it evaluates each criterion in a vectorized way, meaning it remains fast even on large tables. Because date comparisons are simply numeric tests under the hood (dates are stored as serial numbers), SUMIFS handles them effortlessly.
When to use SUMIFS:
- You have data arranged in columns (typical list or table).
- You need to sum a numeric column where the corresponding date column falls on or after a start date and on or before an end date.
- You may later add more criteria such as region, product line, or salesperson.
Prerequisites:
- Data should be in consistent date and number formats.
- Ensure your start and end dates are stored as true dates (serial numbers), not text.
Conceptual logic:
- Evaluate “Date ≥ StartDate”.
- Evaluate “Date ≤ EndDate”.
- For each row where both tests are TRUE, include the value in the sum range.
Syntax:
=SUMIFS(sum_range, criteria_range1, "≥"&StartDate, criteria_range2, "≤"&EndDate)
Where
sum_rangeis the column of numbers to add.criteria_range1andcriteria_range2both reference the same date column.- StartDate and EndDate can be cell references, dynamic formulas such as TODAY(), or hard-coded dates entered with DATE(year, month, day).
Alternative when you cannot use SUMIFS (for example, pre-2007 versions) or need array flexibility:
=SUMPRODUCT( (DateColumn>=StartDate) * (DateColumn<=EndDate) * AmountColumn )
SUMPRODUCT evaluates arrays and multiplies the logical tests (TRUE/FALSE) by the numbers, effectively filtering the rows before summing.
Parameters and Inputs
Before writing any formula, confirm the following:
- Sum range (numeric): Typically a column such as [C2:C5000] holding sales amounts, hours, or costs. Must contain numbers or blanks; text will be ignored.
- Date range: A column such as [B2:B5000] where each cell contains a valid date serial. Avoid mixed data types; blanks are allowed but will not match the criteria.
- Start Date: Can be a cell like [F1] into which a user types a date, or a formula like `=EOMONTH(`TODAY(),-1)+1 (first day of current month). Must evaluate to a valid date.
- End Date: Likewise, a cell or formula such as `=TODAY(`) (locating the current date).
Validation:
- If the start date is later than the end date, SUMIFS returns 0. Build a warning indicator with `=IF(`StartDate>EndDate,\"Check dates\",\"\") to flag the issue.
- Ensure the date range and sum range have identical dimensions; mismatched sizes return a #VALUE! error.
- When importing data, watch for text appearing as dates. Use the DATEVALUE function or Text to Columns to convert them.
Edge cases:
- Leap years are handled automatically; Excel’s serial date system accounts for the extra day.
- Negative values in the sum range (returns, credits) will be included in the total, potentially reducing it. Consider
ABSif you always want positive magnitudes.
Step-by-Step Examples
Example 1: Basic Scenario—Summing Weekly Sales
Imagine a table named SalesData with three columns: Date ([A2:A15]), Product ([B2:B15]), and Revenue ([C2:C15]). You want to know total revenue between 01 Apr 2024 and 07 Apr 2024.
- Enter the two boundary dates in cells [F1] and [G1].
- In [H1] type the label “Weekly Revenue”.
- In [H2] enter:
=SUMIFS(SalesData[Revenue], SalesData[Date], "≥"&$F$1, SalesData[Date], "≤"&$G$1)
- Press Enter. You immediately see the total.
Why it works:
- Excel evaluates every row of SalesData[Date]. If the date is on or after the value in [F1] and on or before the value in [G1], it passes both tests.
- SUMIFS then gathers the corresponding revenue amounts from SalesData[Revenue] and adds them.
Screenshot description: Column A lists dates 01 Apr–10 Apr. After the formula, [H2] displays $18,450, matching the total of revenues dated 01-07 Apr.
Variation: Change [F1] and [G1] to different dates; the total updates instantly. This makes a perfect template for weekly reports.
Troubleshooting tips:
- If the result shows 0, check the date formats in both the table and the criteria cells.
- If you accidentally used < instead of \"≤\" the boundary dates themselves will be excluded.
Example 2: Real-World Application—Quarter-to-Date Operating Expenses
Scenario: The finance department tracks expenses in a table named Expenses with headers Date, Department, Category, Amount. The CFO requests quarter-to-date (QTD) totals for “Operations” only.
- Identify the current fiscal quarter. In [J1] type:
=DATE(YEAR(TODAY()),CHOOSE(ROUNDUP(MONTH(TODAY())/3,0),1,4,7,10),1)
This returns the first day of the current quarter.
2. In [J2] enter `=TODAY(`) for the end date.
3. In [J3] label “Operations QTD”.
4. In [J4] write:
=SUMIFS(Expenses[Amount],
Expenses[Date], "≥"&$J$1,
Expenses[Date], "≤"&$J$2,
Expenses[Department], "Operations")
- Hit Enter. You now have a live QTD figure for Operations.
Business value: This single cell feeds monthly board decks or variance analysis worksheets without manual filtering each month. Because all parameters (quarter start, today’s date, department name) are cell-driven, analysts can repurpose the sheet for any department simply by swapping the label in a dropdown.
Integration: Combine with GETPIVOTDATA to reference the result in a dashboard, or publish via Power BI as a measure if the workbook is imported.
Performance considerations: Even with 100 000 rows, SUMIFS recalculates instantly because it processes its criteria internally rather than as an array formula. Convert the range to an Excel Table (Ctrl + T) so that new expense rows automatically extend the formula’s scope.
Example 3: Advanced Technique—Dynamic Rolling 12-Month Total with Exclusions
Complex requirement: Senior management wants a rolling 12-month sales total, but exclude any orders marked “Test” in the Comments column. They also prefer a zero result rather than #N/A when no data exists inside the window.
Data structure (Table Orders):
- OrderDate ([A2]),
- SalesRep ([B2]),
- Amount ([C2]),
- Comments ([D2]).
Steps:
- Define a dynamic start date in [M1]:
=EDATE(TODAY(),-11)
This returns the same day last year, preserving day-of-month.
2. End date in [M2] is simply `=TODAY(`).
3. In [M3] enter the label “Rolling 12-M Total”.
4. In [M4] construct:
=IFERROR(
SUMIFS(Orders[Amount],
Orders[OrderDate], "≥"&$M$1,
Orders[OrderDate], "≤"&$M$2,
Orders[Comments], "<>Test"
), 0)
Explanation:
- The
"<>"operator combined with “Test” instructs SUMIFS to include rows where Comments is not equal to “Test”. - IFERROR traps the unlikely case of mis-sized ranges or other issues, outputting 0 instead of an error, simplifying downstream charts.
Edge management: Suppose no orders exist yet in the rolling window. SUMIFS returns 0, not blank, maintaining numeric consistency.
Professional tip: Turn the formula into a named range (Formulas > Name Manager) called RollingTotal. You can now drop RollingTotal into scatter plots, apply conditional formatting, or reference it in array formulas.
Performance optimization: When orders exceed 500 000 rows, disable automatic calculation or convert the workbook to a data model measure in Power Pivot. SUMIFS will still be quick, but controlling recalculation prevents accidental slowdown during heavy editing sessions.
Tips and Best Practices
- Store dates in helper cells rather than hard-coding inside the formula. This makes auditing easier and encourages parameter-driven reports.
- Convert source data to an Excel Table. Structured references such as TableName[Date] grow automatically and are more readable than absolute ranges.
- Use TODAY(), EOMONTH, and EDATE for dynamic rolling periods so reports update themselves each morning without user intervention.
- Combine SUMIFS with ABS when you need to ignore sign direction (for instance, add debits and credits as positive amounts).
- Keep criteria ranges adjacent to sum ranges to maximize Excel’s internal caching and speed.
- Document boundary logic directly on the sheet. A small comment or note explaining “Inclusive of both dates” prevents misinterpretation later.
Common Mistakes to Avoid
- Mixing text and real dates in the date column. A single text entry causes SUMIFS to ignore that row, skewing totals. Convert all imported dates with DATEVALUE or Power Query.
- Swapping start and end dates. If StartDate > EndDate, SUMIFS quietly returns 0. Add a validation rule or color the input cells when the order is reversed.
- Forgetting the quotation marks around comparison operators. Writing ≥&A1 instead of \"≥\"&A1 leads to a #NAME? error.
- Mismatched range sizes. criteria_range and sum_range must have identical row counts. Sort your columns side-by-side and check the last row to verify alignment.
- Omitting the ampersand when concatenating comparison operators with date cells. Without \"≥\"&A1, SUMIFS interprets \"≥\" literally and returns 0.
Alternative Methods
| Method | Pros | Cons | Ideal Use Case |
|---|---|---|---|
| SUMIFS | Fast, easy, multiple criteria, works in Excel 2007-current | Not available in Excel 2003 or earlier | Most modern workbooks |
| SUMPRODUCT | Works in all versions, handles arrays, can apply math to results | Slightly slower on large ranges, harder to read | Legacy workbooks, complex logical expressions |
| DSUM | Built-in database function, uses a criteria block | Requires special layout, unfamiliar to many users | Small datasets where criteria block is preferred |
| PivotTable with Report Filter | No formulas, interactive, shows subtotals automatically | Manual refresh required unless using data model, harder to embed inside other formulas | Executive summaries, ad-hoc analysis |
| FILTER + SUM (Excel 365) | Dynamic spill ranges, very readable | Requires Microsoft 365, not backward-compatible | Models built exclusively for modern Excel |
When performance is a concern or backward compatibility is critical, SUMPRODUCT is an excellent fallback. For dashboard views where users want to slice dates interactively, build a PivotTable or PivotChart linked to a Slicer covering the Date field.
FAQ
When should I use this approach?
Use a “sum if date is between” formula whenever you need an inclusive total bounded by two dates. Examples include weekly, monthly, quarterly, fiscal year-to-date, or custom campaign periods.
Can this work across multiple sheets?
Yes. Point the sum_range and criteria_range references to another worksheet, for instance `=SUMIFS(`Sheet2!$C:$C, Sheet2!$A:$A, \"≥\"&Start, Sheet2!$A:$A, \"≤\"&End). For many sheets sharing the same structure, consider consolidating with Power Query or 3-D formulas if ranges align.
What are the limitations?
SUMIFS cannot handle OR logic within the same column without helper ranges. If you need “Date is between range A or between range B”, build two SUMIFS and add them. Also, SUMIFS ignores case but doesn’t allow wildcard comparisons on dates (since dates are numeric).
How do I handle errors?
Wrap the SUMIFS call in IFERROR or test that the input dates are not blank. For example: =IF(COUNT(StartDate,EndDate)<2,"Enter both dates",SUMIFS(...)).
Does this work in older Excel versions?
SUMIFS is available from Excel 2007 forward. For Excel 2003 or earlier, replicate the logic with SUMPRODUCT or DSUM. The formulas produce identical results though performance might differ.
What about performance with large datasets?
SUMIFS is highly optimized but recalculates whenever any referenced cell changes. On datasets exceeding roughly 300 000 rows, disable automatic calculation or leverage the Data Model. In Office 365 you can also use FILTER to shrink the range before summing, reducing overhead.
Conclusion
Mastering “sum if date is between” transforms Excel from a passive data repository into an active decision-making tool. With a single well-structured SUMIFS formula, you can automate weekly sales flashes, produce quarter-to-date KPI dashboards, and respond instantly to ad-hoc management requests. This technique builds the foundation for more advanced analytics such as dynamic rolling windows, multi-criteria segmentation, and Power BI measures. Continue practicing by integrating these formulas with named ranges, tables, and slicers to craft fully interactive workbooks that update themselves while you focus on strategic analysis.
Related Articles
How to Show the 10 Most Common Text Values in Excel
Learn multiple Excel methods to list the 10 most frequent text values—complete with step-by-step examples, business use cases, and expert tips.
How to Abbreviate Names Or Words in Excel
Learn multiple Excel methods to abbreviate names or words with step-by-step examples and practical applications.
How to Abbreviate State Names in Excel
Learn multiple Excel methods to abbreviate state names with step-by-step examples, professional tips, and real-world applications.