ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Conditional math
  3. Sum the Last 30 Days in Excel With SUMIFS and TODAY

Sum the Last 30 Days in Excel With SUMIFS and TODAY

By ExcelReady Team·Updated November 2, 2026·6 min read

The short answer

Use SUMIFS with two date conditions: =SUMIFS(C2:C100,A2:A100,">="&TODAY()-29,A2:A100,"<="&TODAY()). The first condition keeps dates from 29 days ago onwards, the second stops at today, so you get 30 days including today. The total updates every day. Put a fixed date in a cell instead of TODAY() for a report that must not change.

Key takeaways

  • The formula is =SUMIFS(amounts, dates, ">="&TODAY()-29, dates, "<="&TODAY()).
  • TODAY()-29 plus today makes 30 days. Use TODAY()-30 and "<"&TODAY() if today should not count.
  • The operator goes in quotes and joins the date with &. Writing ">=TODAY()-29" in quotes does not work.
  • For a report that must not change, put the report date in a cell and point the formula at that cell.
  • Add more range and criteria pairs to SUMIFS to sum the last 30 days for one customer or category.
On this page+
  1. How to sum the last 30 days with SUMIFS and TODAY
  2. Last 30 days: should today count?
  3. Use a report date cell instead of TODAY
  4. Sum the last 30 days for one customer or category
  5. Count, average and compare the previous 30 days
  6. Why is the last-30-days total wrong or 0?
  7. Practise it

To sum the last 30 days in Excel, use SUMIFS with two date conditions: one for the start of the window, TODAY()-29, and one for the end, TODAY(). The total moves forward by itself every day, so a "last 30 days sales" figure on a dashboard never needs editing. This guide shows the formula, explains why it uses 29 and not 30, and covers the fixes when the total comes out wrong.

How to sum the last 30 days with SUMIFS and TODAY#

SUMIFS adds the numbers in one column when the matching cells in other columns meet every condition you give it. For a rolling 30-day total, both conditions test the same date column:

Excel formula
=SUMIFS(C2:C100,A2:A100,">="&TODAY()-29,A2:A100,"<="&TODAY())
PartWhat it does
C2:C100The amounts to add (the sum range comes first in SUMIFS)
A2:A100,">="&TODAY()-29Keep dates on or after the day 29 days ago
A2:A100,"<="&TODAY()Keep dates up to and including today

TODAY() returns today's date with no time. Excel stores dates as whole numbers (one per day), so TODAY()-29 is simply the date 29 days earlier. The & joins the operator ">=" to that date, which builds a condition such as ">=46297" that SUMIFS can read.

The examples below use this sales table, with a fixed report date of 31 Oct 2026 in F1 so the results don't change:

ABC
1DateCustomerAmount
228 Sep 2026Harbor Cafe450
31 Oct 2026Lime Studio300
42 Oct 2026Harbor Cafe275
514 Oct 2026Bluebird Ltd520
625 Oct 2026Lime Studio180
731 Oct 2026Bluebird Ltd610
83 Nov 2026Harbor Cafe400
Excel formula
=SUMIFS(C2:C8,A2:A8,">="&F1-29,A2:A8,"<="&F1)

The window runs from 2 Oct to 31 Oct, so the result is 275 + 520 + 180 + 610 = 1,585. The 28 Sep and 1 Oct sales are too old, and the 3 Nov sale is after the report date. That end condition matters: without it, future-dated rows such as scheduled orders would sneak into the total.

Last 30 days: should today count?#

"The last 30 days" usually means today plus the 29 days before it, which is why the formula subtracts 29. Count it on your fingers: 2 Oct to 31 Oct is 30 days. Subtracting 30 would give 31 days.

Some reports want the 30 full days before today, because today's sales are not finished yet. Then move both ends back by one and use "less than" for the end:

Excel formula
=SUMIFS(C2:C8,A2:A8,">="&F1-30,A2:A8,"<"&F1)

With 31 Oct as the report date, this covers 1 Oct to 30 Oct and returns 1,275 (300 + 275 + 520 + 180). Neither version is "right": pick the one your team means, and write it in the report label, for example "Last 30 days incl. today".

If your date column holds times as well as dates (for example 31 Oct 2026 14:20), "<="&TODAY() drops today's rows, because 31 Oct at 14:20 is later than 31 Oct at midnight. Use "<"&TODAY()+1 as the end condition instead. The guide on removing the time from a date explains why.

Use a report date cell instead of TODAY#

For a report that must show the same number next week, don't build TODAY() into the formula. Put the report date in a cell and point the formula at it:

  1. In F1, type the report date, or =TODAY() if you do want it to move.
  2. In F2, type =SUMIFS(C2:C8,A2:A8,">="&F1-29,A2:A8,"<="&F1).

Now anyone can change F1 to see any 30-day window, and the formula never needs editing. This is also easier to check: the reader can see which date the total is based on. The same "date in a cell" idea drives month-to-date totals and year-to-date totals. For more on how TODAY() recalculates, see the guide to the TODAY function and the TODAY function reference.

Sum the last 30 days for one customer or category#

SUMIFS takes more conditions in pairs: a range, then its criteria. To total one customer's last 30 days, add a third pair:

Excel formula
=SUMIFS(C2:C8,B2:B8,"Bluebird Ltd",A2:A8,">="&F1-29,A2:A8,"<="&F1)

The result is 1,130 (520 + 610). Put the customer name in a cell, such as H2, and use B2:B8,H2 instead, then fill the formula down a list of customers to get a 30-day total for each one. Lock the ranges with $ first ($C$2:$C$8) so they don't move as you fill.

The SUMIFS function guide lists every argument, and the article on summing between two dates covers fixed start and end dates.

Count, average and compare the previous 30 days#

The same two date conditions work in COUNTIFS and AVERAGEIFS, so you can build a full 30-day summary from one pattern:

QuestionFormulaResult
Sales in the last 30 days=SUMIFS(C2:C8,A2:A8,">="&F1-29,A2:A8,"<="&F1)1,585
Number of orders=COUNTIFS(A2:A8,">="&F1-29,A2:A8,"<="&F1)4
Average order=AVERAGEIFS(C2:C8,A2:A8,">="&F1-29,A2:A8,"<="&F1)396.25
Last 7 days=SUMIFS(C2:C8,A2:A8,">="&F1-6,A2:A8,"<="&F1)790
Previous 30 days (days 31 to 60)=SUMIFS(C2:C8,A2:A8,">="&F1-59,A2:A8,"<="&F1-30)750

The last row lets you compare this month's rolling total with the one before: 1,585 against 750. For more counting patterns, read COUNTIFS with a date range.

Why is the last-30-days total wrong or 0?#

A SUMIFS date formula returns 0 or a strange total for a handful of reasons. Check these in order:

  1. The whole condition is inside quotes. ">=TODAY()-29" is just text to Excel and matches nothing. Keep only the operator in quotes and join with &: ">="&TODAY()-29.
  2. The dates are text. Dates imported from another system often look right but sit on the left of the cell. SUMIFS can't compare them to a date. Convert them first; converting text to dates shows how.
  3. The ranges are swapped or different sizes. In SUMIFS the sum range is first. All ranges must be the same size, or Excel shows #VALUE!.
  4. Dates include times. Today's rows drop out with "<="&TODAY(). Use "<"&TODAY()+1.
  5. The window is off by one. A total that looks one day too long or short usually means 30 where you wanted 29, or the other way round.

Practise it#

Date criteria are a common job-test task because they combine three skills: SUMIFS, operators in quotes and the & join. Practise dates in criteria in a live spreadsheet: you type the formula and it checks it instantly. Then build multi-condition totals in the COUNTIFS and SUMIFS lesson, or try the exercise on this page first.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The report date is in F1. In F2, use SUMIFS to add the Amount (C2:C8) for sales dated from F1-29 up to F1, then press Enter.

fx
ABCDEFG
1
Date
Customer
Amount
Report date
46326
2
46293
Harbor Cafe
450
Last 30 days
3
46296
Lime Studio
300
4
46297
Harbor Cafe
275
5
46309
Bluebird Ltd
520
6
46320
Lime Studio
180
7
46326
Bluebird Ltd
610
8
46329
Harbor Cafe
400
9
10
11

Tip: Sum range first, then the date range twice: ">="&F1-29 for the start and "<="&F1 for the end.

Practise this in a lesson

LessonDates in criteria: totals by date range and monthCount and total rows between two dates with COUNTIFS and SUMIFS, build a monthly summary, and drive the date range from input cells.LessonCOUNTIFS and SUMIFSCount and sum with several conditions at once, and learn why SUMIFS puts the sum range first.Function guideSUMIFSTotal values that meet several conditions with SUMIFS. Examples by region, month and number range, common errors, and live practice.Function guideTODAYUse Excel's TODAY function for days until a deadline, overdue flags and ages that update by themselves. Examples, pitfalls and live practice.

Frequently asked questions

How do I sum the last 30 days in Excel?

+

Use =SUMIFS(C2:C100,A2:A100,">="&TODAY()-29,A2:A100,"<="&TODAY()), where column A holds the dates and column C the amounts. It adds every amount dated from 29 days ago up to and including today.

Should I use TODAY()-29 or TODAY()-30?

+

TODAY()-29 to TODAY() is 30 days including today. If you want the 30 full days before today and not today itself, use ">="&TODAY()-30 with "<"&TODAY().

Why does my last 30 days SUMIFS return 0?

+

The usual causes are dates stored as text, the whole condition written inside quotes such as ">=TODAY()-29", or ranges that point at the wrong columns. Check that the dates are real dates and that the operator is joined to TODAY() with &.

How do I count the orders in the last 30 days?

+

Use COUNTIFS with the same two date conditions: =COUNTIFS(A2:A100,">="&TODAY()-29,A2:A100,"<="&TODAY()). It counts the rows instead of adding the amounts.

Does the last 30 days formula update by itself?

+

Yes. TODAY() recalculates whenever the workbook opens or recalculates, so the 30-day window moves forward each day. To freeze a result, use a fixed date in a cell or paste the result as a value.

Sources

  • SUMIFS function - Microsoft Support
  • TODAY function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How to sum the last 30 days with SUMIFS and TODAY
  2. Last 30 days: should today count?
  3. Use a report date cell instead of TODAY
  4. Sum the last 30 days for one customer or category
  5. Count, average and compare the previous 30 days
  6. Why is the last-30-days total wrong or 0?
  7. Practise it

Keep reading

Conditional math· 7 min read

Sum by Date Range or Month in Excel With SUMIFS

To sum between two dates, give SUMIFS the same date column twice: once with ">="&start and once with "<"&end. For January 2025, write =SUMIFS(D2:D9,A2:A9,">="&DATE(2025,1,1),A2:A9,"<"&DATE(2025,2,1)). Keep the operator in quotes and join the date with &. Using "before the 1st of next month" works for every month.

Dates· 5 min read

TODAY Function in Excel: Always-Current Dates

The TODAY function in Excel returns the current date. Type =TODAY() with empty brackets and no arguments. It updates every time the workbook recalculates, so formulas like =C2-TODAY() always show the days left until a date. For a date that never changes, press Ctrl+; on Windows or Control+; on Mac to type today's date as a fixed value.

Dates· 6 min read

Month-to-Date Totals in Excel

A month-to-date sum adds every amount dated from the first day of the current month up to today. Use SUMIFS with two date conditions: =SUMIFS(C:C,A:A,">="&EOMONTH(TODAY(),-1)+1,A:A,"<="&TODAY()). EOMONTH(TODAY(),-1)+1 is the 1st of this month. Replace TODAY() with a date cell to see the total as of any day.

More on conditional math

  • How to Use SUMIF in Excel
  • SUMIF Blank and Not Blank Cells in Excel
  • SUMIF Contains Text: Sum by Partial Match
  • SUMIF Greater Than or Less Than a Number
  • SUMIF Not Equal To: Exclude a Value From a Total
  • SUMIFS Between Two Numbers: Sum Values in a Range
All conditional math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free