How to Use SUMIFS in Excel to Total Expenses by Month and Department
Steps
To total expenses by month and department, use SUMIFS with three conditions: the department name, a date on or after the month’s first day, and a date before the next month begins. Excel adds only the amounts whose rows satisfy every condition. This guide shows how to build that formula, turn it into a reusable monthly report, and check the results. (support.microsoft.com)
How does SUMIFS total expenses by month and department?
The adds values from an amount range when corresponding cells meet all specified criteria. For monthly departmental expenses, it checks the department column once and the date column twice, creating a date window for one calendar month. Each qualifying transaction contributes its amount to the total. (support.microsoft.com)
The basic syntax is:
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Read it as: add these amounts, but only where these conditions are true. The amount range comes first, followed by pairs consisting of a range to check and a condition to apply. (support.microsoft.com)
For this report, the three pairs represent:
- Department: matches the department selected for the report.
- Starting date: is greater than or equal to the month’s first day.
- Ending boundary: is less than the first day of the following month.
This is a practical application of the : all three tests must pass for the same transaction. (microsoftpressstore.com)
Prepare a clean expense list
For the worked example, enter these fictional transactions in cells A1:C8, with the headers in row 1. Keep each transaction on its own row, and place the summary elsewhere on the worksheet.
| Date | Department | Amount |
|---|---|---|
| Jan 3, 2026 | Marketing | 250 |
| Jan 8, 2026 | Sales | 400 |
| Jan 15, 2026 | Marketing | 175 |
| Jan 31, 2026 | Marketing | 125 |
| Feb 2, 2026 | Marketing | 300 |
| Feb 10, 2026 | Sales | 225 |
| Jan 12, 2025 | Marketing | 90 |
Use actual Excel dates in column A and numeric amounts in column C. A date-looking text string is not necessarily a usable date, so check imported records before building your summary. Microsoft documents that text dates can prevent Excel from recognizing date values correctly. (support.microsoft.com)
Use one consistent department label throughout this example. Keep currency symbols out of typed text amounts; apply a currency number format instead. Before proceeding, inspect the January Marketing entries: the expected total is 550, from 250 + 175 + 125.
Build the monthly expense formula
Create a small control area next to the expense list:
| Cell | Enter |
|---|---|
| E1 | Month start |
| E2 | =DATE(2026,1,1) |
| F1 | Department |
| F2 | Marketing |
| G1 | Total expenses |
In G2, enter:
=SUMIFS($C$2:$C$8,$B$2:$B$8,F2,$A$2:$A$8,">="&E2,$A$2:$A$8,"<"&EDATE(E2,1))
For the sample data, the result is 550. The February Marketing expense fails the upper date test, the Sales expenses fail the department test, and the January 2025 transaction fails the lower date test.
Understand each part
The formula combines these components:
| Component | Purpose |
|---|---|
| $C$2:$C$8 | Supplies the amounts to add |
| $B$2:$B$8,F2 | Checks for the department in F2 |
| $A$2:$A$8,">="&E2 | Includes dates from the selected month’s start |
| $A$2:$A$8,"<"&EDATE(E2,1) | Excludes dates from the following month onward |
The ampersand joins a comparison operator to a cell value, forming criteria such as “greater than or equal to this date.” EDATE moves the starting date forward by the specified number of months; with the first day in E2, EDATE(E2,1) provides the next month’s first day. (support.microsoft.com)
Use a complete date window
Keep E2 set to the first day of the month. Starting on January 15 would create a January 15–February 14 reporting window instead of a January total.
The exclusive upper boundary also handles timestamps: an expense dated January 31 at 3 p.m. is still earlier than February 1. Excel represents times as fractions of a day, so this approach avoids excluding transactions recorded after midnight on the final day. It also keeps different years separate. (support.microsoft.com)
How do you copy the formula across months and departments?
Build a matrix with month-start dates across the top and department names down the left. Use mixed references so each copied formula reads the month above its column and the department beside its row, while the source ranges remain fixed. Excel’s dollar signs lock a reference’s row, column, or both when formulas are copied. (support.microsoft.com)
For this example, arrange the summary as follows:
- E5: Department
- F5: =DATE(2026,1,1)
- G5: =EDATE(F5,1)
- E6: Marketing
- E7: Sales
In F6, enter:
=SUMIFS($C$2:$C$8,$B$2:$B$8,$E6,$A$2:$A$8,">="&F$5,$A$2:$A$8,"<"&EDATE(F$5,1))
Copy F6 across to G6, then copy both cells down to row 7. Here, $E6 keeps the department column fixed, while F$5 keeps the month-header row fixed. The fully absolute source references do not shift. (support.microsoft.com)
Your sample report should show:
| Department | January 2026 | February 2026 |
|---|---|---|
| Marketing | 550 | 300 |
| Sales | 400 | 225 |
Make the source range easier to maintain
The sample formulas stop at row 8. For an ongoing report, consider converting the source list into an Excel Table named Expenses, with columns named Date, Department, and Amount. Table references adjust when rows are added or removed, reducing the risk of leaving new transactions outside a fixed range. (support.microsoft.com)
Using the earlier control cells E2 and F2, the formula becomes:
=SUMIFS(Expenses[Amount],Expenses[Department],F2,Expenses[Date],">="&E2,Expenses[Date],"<"&EDATE(E2,1))
Enter this formula outside the source table. The column names make its purpose easier to inspect: sum Amount, check Department, and apply two conditions to Date. When adding transactions, confirm that they are actually inside the table so its references include them. (support.microsoft.com)
: choose the right function
Use SUMIF for a single condition, such as all Marketing expenses regardless of date. Use SUMIFS when several conditions must apply together, as in this monthly report. Their argument order differs, so changing the function name alone is not enough. (support.microsoft.com)
For comparison, a department-only formula is:
=SUMIF(B2:B8,"Marketing",C2:C8)
In this sample, it returns 940, including both years and February. The monthly SUMIFS formula returns 550 because its date conditions narrow the selection. When learning , check the business question first: “Marketing expenses” and “Marketing expenses for January 2026” require different conditions.
Troubleshoot before trusting the report
A result that looks reasonable can still be wrong. Check the formula against a small, known set of transactions before copying it throughout your workbook. Use the following checks when reviewing this example or adapting it to your own expense list:
| Symptom | Check and correction |
|---|---|
| #VALUE! error | Make every criteria range the same size as the amount range. Do not mix C2:C8 with A2:A100. |
| Error with another workbook | Open the referenced source workbook; SUMIFS references to closed workbooks can produce #VALUE!. |
| Unexpected zero | Inspect the department label and verify that imported dates are actual dates, not text. |
| Wrong period included | Check that the start cell contains the intended month’s first day and the upper boundary uses the next month. |
Microsoft identifies unequal range dimensions and closed-workbook references as SUMIFS error causes, and documents text-date recognition problems separately. (support.microsoft.com)
For a final check, reconcile January Marketing to 550 and January Sales to 400. Then change the month control to February and verify 300 and 225 respectively. This small test validates the department selection, date boundaries, and expected output before you rely on the report for broader .
FormMaster
Like