Excel and Google Sheets how-to
Total amounts by month with SUMIFS
A list of dated expenses and you want one total per month. SUMIFS adds every amount between the first and the last day of the month.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Date | Amount | Category | Month | Total | |
| 2 | 2026-01-05 | 120.00 | Fuel | Jan 2026 | 200.00 | |
| 3 | 2026-01-18 | 80.00 | Office | Feb 2026 | 210.00 | |
| 4 | 2026-02-02 | 150.00 | Fuel | Mar 2026 | 245.00 | |
| 5 | 2026-02-27 | 60.00 | Meals | |||
| 6 | 2026-03-10 | 200.00 | Office | |||
| 7 | 2026-03-31 | 45.00 | Fuel |
Sample data. Dates in A, amounts in B, the first day of each month in E (shown as Jan 2026), the formula in F2 is copied down.
The formula
In column E, type the first day of each month (1 Jan 2026 in E2, 1 Feb 2026 in E3, and so on). Click F2 and type:
=SUMIFS(B:B,A:A,">="&E2,A:A,"<="&EOMONTH(E2,0))F2 shows 200.00: 120 on 5 Jan plus 80 on 18 Jan. Copy it down and February shows 210.00 and March 245.00.
- B:B is the column to add up.
- A:A,">="&E2 keeps dates on or after the first of the month.
- A:A,"<="&EOMONTH(E2,0) keeps dates on or before the last day of that month. EOMONTH(E2,0) is 31 Jan 2026.
The & joins the sign to the date, so only the sign goes in quotes. Your dates must be real dates, not text (see the last section).
Show the month name
E2 holds a full date, 1 Jan 2026. To show it as Jan 2026, give column E a custom date format. In Excel, select the cells, press Ctrl+1, choose Custom on the Number tab and type mmm yyyy in the Type box. In Google Sheets, select the cells, then Format > Number > Custom date and time. The formula still sees the date underneath. If any cell shows a number like 46053 instead of a date, it only needs a date format.
One category in one month
Add one more range and condition pair at the end:
=SUMIFS(B:B,A:A,">="&E2,A:A,"<="&EOMONTH(E2,0),C:C,"Fuel")Fuel in January is 120. Change E2 to E4 and Fuel in March is 45: the 31 March entry counts, because the last day of the month is included.
Count and average by month
The same date conditions work in COUNTIFS and AVERAGEIFS. How many entries in January?
=COUNTIFS(A:A,">="&E2,A:A,"<="&EOMONTH(E2,0))That gives 2. The average amount in January:
=AVERAGEIFS(B:B,A:A,">="&E2,A:A,"<="&EOMONTH(E2,0))That gives 100, and with E4 March gives 122.5.
This month so far
EOMONTH(TODAY(),-1) is the last day of last month, so adding 1 gives the first day of this month. Total everything from then up to today:
=SUMIFS(B:B,A:A,">="&EOMONTH(TODAY(),-1)+1,A:A,"<="&TODAY())It updates by itself every day and starts again at 0 on the first of each month.
Dates with a time attached
Exports and form responses often store a time with the date. An entry at 2:30 PM on 31 Jan is later than 31 Jan itself, so the "<=" end of month misses it. Ask for dates before the first day of the next month instead:
=SUMIFS(B:B,A:A,">="&E2,A:A,"<"&EDATE(E2,1))EDATE(E2,1) is 1 Feb 2026. With plain dates it gives the same 200; with a 50.00 entry at 2:30 PM on 31 Jan, the first formula leaves it out and this one counts it.
The total shows 0
The usual cause: the dates are text that only looks like dates, often after a paste or an import. Text dates tend to sit on the left of the cell. Check one:
=ISNUMBER(A2)TRUE means a real date. FALSE means text, and SUMIFS skips it. DATEVALUE turns text like 2026-01-05 into a real date:
=DATEVALUE(A2)Put it in a spare column, copy it down, give it a date format, then paste the results back as values. SUMIFS, COUNTIFS, AVERAGEIFS, EOMONTH and EDATE work in every current version of Excel and in Google Sheets.
Templates with the math already done
Rather skip the formulas? These templates come with every formula built and checked, plus a filled-in sample.
- Monthly Budget TrackerBudget vs actual, bills and savings.
- Small Business Expense TrackerEvery business expense in one list, sorted into your own categories, with the sales tax you paid.
- Sales Tracker and Dashboard 2027Log every sale and see revenue, top products and top customers on a dashboard.
More how-tos
- Find a price by its code with XLOOKUPType a product code, get its price back from your price list. One formula, no helper columns.
- Total each category with SUMIFSAdd up all the Fuel, all the Office, all the Meals: one formula per category, and more rules when you need them.
- Check two conditions at once with IF and ANDFree shipping only when the order is 50 or more and ships in Canada: one IF, one AND, done.
- Add leading zeros to numbersType 00021 and Excel or Google Sheets shows 21, because to them it is just the number 21. Here is how to get the zeros back, and keep them.
- Fix #DIV/0! in an averageAn average of nothing is a division by zero, so AVERAGE shows #DIV/0! until the first number arrives. One IF fixes it.
- Count rows that meet two conditions with COUNTIFSHow many of Ana's deals were 500 or more? COUNTIFS answers it in one cell, and takes as many rules as you need.
- Calculate percentage changeSales went from 400 to 500. That is a 25% increase, and one short formula works it out for every row.
- Calculate years of service from a start dateAna started on 15 March 2019. How many full years has she worked? DATEDIF counts them, and the same formula works out an age from a date of birth.
- Combine first and last name into one cellFirst names in one column, last names in the next, and you need "Ana Lopez" in one cell. The & sign joins them.
- Find duplicates in a list with COUNTIFA mailing list where some people signed up twice. One formula shows how many times each email appears, so the repeats stand out.
- Split a full name into first and last nameYour list has "Ana Lopez" in one cell and you need Ana and Lopez in two. Two short formulas find the space and split there.
- Count working days between two datesAna is off from 1 Oct to 14 Oct. How many working days is that? NETWORKDAYS counts Monday to Friday and leaves out the weekends.
- Free pricing calculatorsPrice a job from your real costs and margin. No sign up.






