Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • How to use Excel VLOOKUP Function
  • How to get address of last cell in range in Excel
  • How to use Excel INDIRECT Function
  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • Two-column Lookup in Excel

Data Analysis Examples

  • Calculate Conditional Percentile ‘IF’ in table in Excel
  • How to calculate current stock or inventory in Excel
  • How To Sort One Column or Multiple Columns in Excel
  • Number and Text Filters Examples in Excel
  • Use Data Form to input, edit and delete records in Excel

Data Validation Examples

  • Excel Data validation number multiple 100
  • Excel Data validation exists in list
  • Excel Data validation no punctuation
  • Excel Data validation require unique number
  • Excel Data validation date in specific year

Sum sales in last 30 days by ID in Excel

by

This tutorial shows how to Sum sales in last 30 days by ID in Excel using the example below:

Formula

=SUMIFS(amounts,dates,">="&TODAY()-30,ids,id)

Explanation

To sum sales in the last 30 days by an id (like name, initials, region, etc.) you can use the SUMIFS function together with the TODAY function. In the example shown, the formula in G5, copied down, is:

Worked Example:   SUMIFS with multiple criteria and OR logic in Excel
=SUMIFS($D$5:$D$104,$C$5:$C$104,">="&TODAY()-30,$B$5:$B$104,F5)

How this formula works

The SUMIFS function can handle multiple criteria when calculating a sum. In this case, SUMIFS is configured with a sum range for all amounts:

=SUMIFS($D$5:$D$104

The first criteria specifies a criteria range that contains all dates, with a criteria of greater than or equal to the current date minus 30:

=SUMIFS($D$5:$D$104,$C$5:$C$104,">="&TODAY()-30

The second criteria specifies a criteria range of all IDs, with a criteria of a single ID pulled from column F:

=SUMIFS($D$5:$D$104,$C$5:$C$104,">="&TODAY()-30,$B$5:$B$104,F5)

Note ranges for amounts, dates, and ids are absolute references, so that they won’t change when copied. When the formula is copied down column G, SUMIFS calculates total sales in the last 30 days for each ID in the table.

Worked Example:   IF with boolean logic in Excel

Total sales in the last 30 days

To get a sum for total sales in the last 30 days, just omit the second criteria:

SUMIFS(amounts,dates,">="&TODAY()-30)

For the example above, this becomes:

SUMIFS($D$5:$D$104,$C$5:$C$104,">="&TODAY()-30)
Worked Example:   How to conditionally sum numeric data in an Excel table using SUMIFS

Post navigation

Previous Post:

Summary count with percentage breakdown in Excel

Next Post:

SUMIFS with multiple criteria and OR logic in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • How to strip non-numeric characters in Excel
  • PROPER function: Description, Usage, Syntax, Examples and Explanation
  • Clean and reformat telephone numbers using SUBSTITUTE function in Excel
  • How to remove trailing slash from url in Excel
  • SUBSTITUTE function vs REPLACE function in Excel
  • Add years to date in Excel
  • How to calculate Quarter of Date in Excel
  • Display Date is same month in Excel
  • Add days to date in Excel
  • DATE function: Description, Usage, Syntax, Examples and Explanation
  • Example of payment for annuity in Excel
  • Calculate interest rate for loan in Excel
  • CUMPRINC function: Description, Usage, Syntax, Examples and Explanation
  • ACCRINTM function: Description, Usage, Syntax, Examples and Explanation
  • MIRR function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2022 xlsoffice . All Right Reserved. | Teal Smiles