To sum values within a date range in Excel, use the SUMIFS function. The basic formula structure is =SUMIFS(sum_range, date_range, ">="&start_date, date_range, "<="&end_date). This allows you to target a specific column of numbers and filter them based on a start date and an end date, ensuring only the values falling between those two points are totaled.
What You'll Need
- A dataset containing a column of dates and a corresponding column of numerical values to sum.
- A version of Microsoft Excel that supports the SUMIFS function (Excel 2007 or newer).
- Two cells containing your desired start date and end date, or the dates typed directly into the formula.
- Dates formatted as actual Date types in Excel, not as text strings.
Step-by-Step
- Prepare Your Data Layout: Ensure your data is organized in columns. For example, place your dates in Column A and the values you want to sum in Column B. It is highly recommended to use an Excel Table (Ctrl+T) for your data, as this allows the formula to update automatically if you add new rows to your list.
- Set Up Your Criteria Cells: Instead of hard-coding dates into the formula, designate two specific cells to hold your date range. For instance, put your start date (e.g., 01/01/2023) in cell D2 and your end date (e.g., 12/31/2023) in cell E2. This makes your spreadsheet dynamic, allowing you to change the date range without editing the formula itself.
- Enter the SUMIFS Function: Click on the cell where you want the total to appear and type
=SUMIFS(. The SUMIFS function is designed to sum cells that meet multiple criteria. - Select the Sum Range: The first argument is the range of cells you want to add up. If your values are in Column B, highlight that range (e.g., B2:B100). This tells Excel, "These are the numbers I want to total."
- Define the First Criterion (Start Date): Now you must tell Excel to look at the dates and only include those on or after the start date. First, select the date range (e.g., A2:A100). Then, add a comma and enter the operator and the cell reference. To do this correctly, you must put the operator in quotes and use an ampersand to join it to the cell:
">="&D2. This translates to "greater than or equal to the date in cell D2." - Define the Second Criterion (End Date): Since you want a range, you need a second boundary. Repeat the date range selection (A2:A100), add a comma, and enter the operator for the end date:
"<="&E2. This translates to "less than or equal to the date in cell E2." - Close the Formula: Close the parenthesis and press Enter. Your final formula should look like this:
=SUMIFS(B2:B100, A2:A100, ">="&D2, A2:A100, "<="&E2). - Verify the Result: To double-check the accuracy, you can temporarily filter your date column using the Filter tool (Data > Filter) to see if the visible sum matches the result of your formula.
Common Mistakes
One of the most frequent errors is forgetting the ampersand (&) when referencing a cell for the date. If you write ">=D2" , Excel searches for the literal text "D2" rather than the date stored inside cell D2. The operator must be in quotes, but the cell reference must be outside those quotes, linked by the ampersand.
Another common mistake is using the SUMIF function instead of SUMIFS. While SUMIF can handle a single condition (like "everything after January 1st"), it cannot handle two separate conditions for the same range (both a start and an end date) in a single operation. Using SUMIFS is the standard for date ranges because it allows for an unlimited number of criteria.
Incorrect date formatting is also a major pitfall. If your dates are aligned to the left of the cell, Excel likely perceives them as text. SUMIFS will ignore text strings that look like dates, resulting in a total of 0. You can fix this by selecting the column and changing the format to "Short Date" or using the Text-to-Columns tool to convert text dates back into actual date values.
Lastly, users often forget that the sum range and the criteria ranges must be the exact same size. If your sum range is B2:B100 but your date range is A2:A50, Excel will return a #VALUE! error. Ensure the row numbers match perfectly across all ranges in the formula.
Tips
To make your report more professional, use the TODAY() function for one of your date boundaries. For example, if you want to sum all values from a specific start date up until today, replace the end date reference with ">="&TODAY() . This ensures your total is always current every time you open the file.
If you are working with very large datasets, consider using a Pivot Table instead of a formula. By dragging the date field into the "Rows" area and the value field into the "Values" area, you can right-click any date and select "Group..." to quickly sum by month, quarter, or year without writing a single formula.
For those who prefer a cleaner look, you can use Named Ranges. Instead of referencing A2:A100, you can name that range "TransactionDates" and B2:B100 as "Amounts". Your formula then becomes =SUMIFS(Amounts, TransactionDates, ">="&D2, TransactionDates, "<="&E2), which is much easier to read and audit.
If you need to sum values that are strictly *between* two dates (excluding the start and end dates themselves), simply remove the equals sign from the operators. Use ">"&D2 and "<"&E2 instead of ">=" and "<=" .
Troubleshooting
If your formula returns 0 but you know there are values in that range, first check for "hidden" time stamps. If your cells contain both a date and a time (e.g., 12/31/2023 11:59 PM), a simple "<="&E2 where E2 is 12/31/2023 might exclude that final day because 11:59 PM is technically greater than the start of that day. To fix this, either set your end date to the following day or use the INT function to strip the time from your data.
If you see a #VALUE! error, check your range dimensions. Ensure that the sum range and all criteria ranges start and end on the same row numbers. If one range is A2:A100 and another is B1:B100, the mismatch will trigger this error.
If the formula returns a date instead of a number, it is a formatting issue. Excel sometimes tries to be helpful by copying the format of the nearby date cells into your result cell. Go to the Home tab, find the Number Format dropdown, and change it from "Date" to "Currency" or "Number".
If the formula is not updating when you change the date in D2 or E2, check if your Calculation Options are set to Manual. Go to the Formulas tab > Calculation Options and ensure "Automatic" is selected.
Frequently Asked Questions
Can I sum values for a specific month regardless of the year?
SUMIFS cannot do this directly because it looks for a range. To sum a specific month across multiple years, you should create a helper column using the =MONTH() function to extract the month number, then use SUMIF to total the values associated with that specific month number.
How do I sum values between two dates if the dates are written inside the formula?
You can use the DATE function inside the SUMIFS formula. For example: =SUMIFS(B2:B100, A2:A100, ">="&DATE(2023,1,1), A2:A100, "<="&DATE(2023,12,31)). This is safer than typing dates as text, as it avoids errors caused by different regional date formats (MM/DD vs DD/MM).
Does this work with Excel Online or Google Sheets?
Yes, the SUMIFS function is a standard formula that works identically in Excel Online and Google Sheets. The syntax for the operators and the ampersand remains the same across these platforms.
What if I have multiple criteria other than dates?
You can simply keep adding pairs of ranges and criteria to the end of the SUMIFS formula. For example, if you want to sum values between two dates AND for a specific category in Column C, add , C2:C100, "CategoryName" to the end of your existing formula.
Why is my SUMIFS formula ignoring some rows that seem to be in the date range?
This is usually caused by leading or trailing spaces in the date cells or the dates being stored as text. Use the TRIM function or the "Text to Columns" feature to clean your date column and ensure every entry is recognized as a valid serial date by Excel.