How to Sum Last 30 Days in Excel

Learn multiple Excel methods to sum last 30 days with step-by-step examples and practical applications.

excelformulaspreadsheettutorial
11 min read • Last updated: 7/2/2025

How to Sum Last 30 Days in Excel

Why This Task Matters in Excel

Tracking the most recent 30 days of activity is a fundamental need in almost every data-driven environment. Finance teams monitor cash receipts for the past month to gauge liquidity. Sales managers look at the previous 30 days of orders to track momentum, while marketers measure campaign clicks or impressions over the last rolling month to optimize spend. Operations departments often examine the latest 30 days of production output to catch dips in efficiency before they become expensive problems. For these—and countless other—scenarios, decision makers care less about calendar months and more about “today minus 29 days,” because it offers an up-to-the-minute perspective.

Excel is uniquely suited for this rolling-window analysis. First, dates in Excel are stored as serial numbers, which makes arithmetic straightforward. Second, Excel’s conditional aggregation functions (SUMIFS, SUMPRODUCT, and the newer FILTER + SUM combination in Microsoft 365) let you apply dynamic date criteria so the total self-updates every morning when you open the file. Without a solid grasp of how to sum the last 30 days, analysts often waste time creating manual month-to-date snapshots, forgetting that February has 28 or 29 days, or re-running reports with hard-coded end dates. Worse, they risk making decisions on stale information. Mastering this rolling-sum technique shortens report refresh cycles, ties neatly into dashboards, and underpins advanced skills such as dynamic cohort analysis, rolling averages, and predictive modeling.

Beyond dashboards, summing the last 30 days plugs directly into other Excel workflows. You can feed the result into charts for trend lines, conditionally format numbers that fall below thresholds, or compare the rolling sum against forecast figures stored elsewhere. For Power Query users, knowing how to perform a last-30-days check lets you filter data at the query stage, trimming large files before they even load into the workbook. In short, this skill is a bedrock competency that unlocks many other time-based analyses.

Best Excel Approach

The all-purpose, version-agnostic workhorse for summing the last 30 days is the SUMIFS function. Why? It is available in every modern desktop version (from Excel 2007 onward), supports multiple criteria, and recalculates automatically. You supply a sum range (the numbers), then one or more pairs of criteria ranges and criteria. The logic is simple: sum rows where the date is greater than or equal to today minus 29 days and less than or equal to today.

Syntax of our recommended formula:

=SUMIFS(Sales_Amount, Date_Column, ">="&TODAY()-29, Date_Column, "<="&TODAY())

Where:

  • Sales_Amount is the range (or structured table column) containing the numbers to total.
  • Date_Column is the range containing the dates.
  • \">=\"&TODAY()-29 collects dates from 29 days ago through today.
  • \"<=\"&TODAY() caps the window at the current date.

Use this approach when:

  • Your workbook needs to run on older Excel versions.
  • Your data sits in a normal sheet or an Excel Table.
  • You need readable formulas that non-experts can audit.

If you have Microsoft 365 or Excel 2021, a dynamic array alternative can feel more natural:

=SUM(FILTER(Sales_Amount, (Date_Column>=TODAY()-29)*(Date_Column<=TODAY())))

FILTER returns only the rows meeting both date tests, and SUM aggregates them. This method is more flexible (you can pass the filtered data elsewhere) but requires the latest Excel.

Parameters and Inputs

  • Date_Column: Must contain genuine Excel date values, not text that looks like dates. They can include times; Excel will still evaluate the date portion correctly.
  • Sales_Amount (or the numeric range you are summing): Should be numeric. If blank cells exist, SUMIFS treats them as zero—usually harmless, but worth noting.
  • Optional Spill Safety: If you use FILTER + SUM, ensure no merged cells exist below the formula; dynamic arrays need unobstructed spill ranges.
  • Data Preparation: Remove duplicate headers, clear stray text entries, and ensure no negative dates (rare, but possible when data imports incorrectly).
  • Locale Considerations: TODAY() respects the system clock, so spreadsheets shared across time zones may display different “today” until the file is saved with static dates.
  • Edge Dates: If your data includes future dates, the upper criteria \"<=\"&TODAY() prevents them from inflating the rolling sum. If you want to look exclusively at past activity, keep this second criterion.
  • Validation: Drop-down lists or data-validation rules to restrict date input reduce errors. You can also wrap the formula in IFERROR when using FILTER, but SUMIFS rarely throws errors unless ranges are mis-sized.

Step-by-Step Examples

Example 1: Basic Scenario

Imagine a simple daily sales log:

A (Date)B (Sales)
05-Aug-20231200
06-Aug-2023980
02-Sep-20231 045

1 . Convert the range [A1:B100] into an Excel Table (Ctrl + T) and name it SalesTbl. The date column auto-collects the name SalesTbl[Date] and the amount column SalesTbl[Sales].

2 . In any empty cell (say D2) enter:

=SUMIFS(SalesTbl[Sales], SalesTbl[Date], ">="&TODAY()-29, SalesTbl[Date], "<="&TODAY())

3 . Press Enter. You see one number: the cumulative sales of the last 30 days counting back from today inclusive.

Why it works: Excel stores 02-Sep-2023 as 45152 (for example). TODAY() also returns a serial number. Subtracting 29 yields the serial for 04-Aug-2023. SUMIFS scans SalesTbl[Date]; rows with values between those two bounds pass the test, and their Sales get added.

Common variations:

  • Rolling 7 days: swap 29 for 6.
  • Rolling 30 days excluding today: change the upper bound to \"<\"&TODAY().
    Troubleshooting: If the result is zero, check that dates are genuine (try formatting them as General; they should turn into five-digit numbers). If the formula returns #VALUE!, ranges are mis-sized.

Example 2: Real-World Application

Scenario: A subscription SaaS business wants to know how many new users signed up in the last 30 days to display on a dashboard. Data arrives daily from a backend export with 200 000 rows across multiple columns.

Data layout (simplified):

ABCD
UserIDSignUpDatePlanRevenue

Steps:

1 . Import the CSV into Power Query (Data ➜ Get Data) and load to a worksheet table named UserTbl.
2 . Because SignUpDate includes time stamps (e.g., 2023-09-02 14:22), ensure the column is Date/Time in Power Query, then click Close & Load.
3 . In the dashboard sheet, create a named formula RollingUsers:

=COUNTIFS(UserTbl[SignUpDate], ">="&TODAY()-29, UserTbl[SignUpDate], "<="&TODAY())

(We switched from SUMIFS to COUNTIFS because we count rows rather than sum money.)

4 . Link a KPI card or gauge chart to RollingUsers. As soon as the data model refreshes tomorrow, the number updates automatically.

Business benefits: Stakeholders always see the latest subscriber pulse, no manual month-end report needed. This technique scales: COUNTIFS can handle hundreds of thousands of rows quickly. If performance becomes sluggish, move the logic into Power Query’s Filter step or into a PivotTable using the date slicer set to “Last 30 Days.”

Example 3: Advanced Technique

Scenario: A retailer tracks daily store sales but wants to show the last 30 days of same-store revenue only, excluding new outlets that opened partway through the period.

Data columns:

| Date | StoreID | OpenDate | DailySales |

Goal: Sum DailySales for rows where Date is within the last 30 days and OpenDate is at least 30 days old (meaning the store operated throughout the window).

Dynamic array solution (Microsoft 365):

=SUM(FILTER(DailySales, (Date>=TODAY()-29)*(Date<=TODAY())*(OpenDate<=TODAY()-29)))

Breakdown:

  • (Date>`=TODAY(`)-29) picks rows in the window.
  • (OpenDate<`=TODAY(`)-29) ensures the store wasn’t brand-new.
  • The multiplication acts as AND logic in FILTER.

Performance optimization: Convert the worksheet to the Excel Data Model and run the calculation in a Power Pivot measure using DAX—ideal when you cross-filter by region. Still, the worksheet formula above is perfect during prototyping.

Error handling: If FILTER returns nothing (all stores opened recently), SUM raises a #CALC! error. Wrap it:

=LET(tmp,FILTER(DailySales, (Date>=TODAY()-29)*(Date<=TODAY())*(OpenDate<=TODAY()-29)), IFERROR(SUM(tmp),0))

Professional tip: LET assigns the filtered array to tmp, letting you sum it twice or use it elsewhere without recomputing.

Tips and Best Practices

1 . Use Excel Tables: Structured references update automatically as new rows are added; no need to adjust range addresses.
2 . Anchor your end date: For historical re-runs, replace TODAY() with a cell (e.g., [G1]) so analysts can view any 30-day slice.
3 . Cache with LET: If your criteria are complex, store interim arrays in variables to improve readability and performance.
4 . Avoid volatile NOW(): TODAY() recalculates once per session, but NOW() is volatile and can slow large workbooks.
5 . Combine with Conditional Formatting: Highlight days where today’s rolling sum dips below targets for instant visual cues.
6 . Document assumptions: Note whether your 30-day window is inclusive of today; future editors will thank you.

Common Mistakes to Avoid

1 . Mixing Text Dates and True Dates: If even one “2023/09/02” string sneaks into a date column, SUMIFS silently ignores that row. Always test with COUNT of numeric values.
2 . Mismatched Range Sizes: SUMIFS demands equal-length ranges; if Sales_Amount spans [B2:B1000] but Date_Column is [A2:A950], you get #VALUE!. Resize or convert to a Table.
3 . Using Hard-Coded End Dates: Typing \">=\"&\"8/4/2023\" stops the formula from rolling forward. Reference TODAY() or a cell.
4 . Forgetting the Upper Bound: People often write only \">`=TODAY(`)-29\". Future-dated rows then join the party and inflate totals. Always close the window with \"<=\"&TODAY().
5 . Time Stamp Trap: If your export stores order dates as dates but delivery dates as date-times, criteria like \"<=\"&TODAY() still work, but manual filters in the UI can show mismatches. Normalize to pure dates when possible.

Alternative Methods

MethodProsConsBest For
SUMIFSWorks in all modern Excels; simple syntax; fastCannot return intermediate rows; criteria concatenation can look messyCompany-wide templates, backwards compatibility
FILTER + SUMDynamic arrays provide live spill data; easy to audit intermediate rowsRequires Microsoft 365/Excel 2021; #CALC! errors if no dataPersonal dashboards, exploratory analysis
SUMPRODUCTHandles complex logic in one expression; no need for helper columnsHarder to read; performance slower on very large rangesPower users needing array logic in older Excel
PivotTables with Date FiltersDrag-and-drop UI; can group by days or weeks; good for large dataRefresh step needed; result sits in a separate grid, not a single cellReporting where users prefer GUI over formulas
Power Query FilteringOffloads workload before data reaches Excel grid; can load lightweight tablesRequires refresh; formula not in cell; less interactiveVery large files, scheduled refresh environments

Choose SUMIFS for reliability, FILTER for interactivity, SUMPRODUCT when you need advanced math on older versions, PivotTables for visual summaries, and Power Query when file size or refresh automation is critical.

FAQ

When should I use this approach?

Use a rolling 30-day sum whenever you need the freshest picture of activity regardless of where the calendar month starts or ends—sales trends, call-center tickets, sensor readings, or cash flow forecasting.

Can this work across multiple sheets?

Yes. Reference ranges with sheet names:

=SUMIFS('Jan Data'!B:B,'Jan Data'!A:A,">="&TODAY()-29,'Jan Data'!A:A,"<="&TODAY())

Or use 3D SUMIFS by consolidating sheets into Power Query, then apply the same DATE logic.

What are the limitations?

SUMIFS accepts up to 127 criteria pairs, but the real limit is worksheet performance. Also, TODAY() updates when the workbook recalculates, not at midnight while the file sits open. For near real-time dashboards, use NOW() plus INT() to floor to midnight.

How do I handle errors?

SUMIFS rarely errors. FILTER can. Wrap FILTER inside IFERROR or test for COUNTA of the filtered array first. Always validate that your date column contains numeric values.

Does this work in older Excel versions?

SUMIFS is available from Excel 2007 onward. FILTER needs Microsoft 365 or Excel 2021. If you run Excel 2003 or earlier, fall back to SUMPRODUCT with date comparisons.

What about performance with large datasets?

  • Turn ranges into Excel Tables to leverage intelligent caching.
  • Avoid entire column references like A:A in SUMIFS; restrict to realistic used ranges.
  • If data tops one million rows, move logic into Power Query or the Data Model.
  • Disable automatic calculation while importing data, then trigger a full calc once.

Conclusion

Rolling 30-day sums give stakeholders an always-current insight, free from the quirks of calendar months. Whether you use SUMIFS for universal compatibility or the sleeker FILTER + SUM combo, mastering this skill accelerates dashboard creation, enhances data-driven decisions, and sets the foundation for more sophisticated time-series analyses. Keep practicing with your own datasets, experiment with dynamic end dates, and soon summing the last 30 days will feel as natural as AutoSum. Happy analyzing!

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.