• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Excel Shortcut When Using Dates as Formula Criteria

You are here: Home / Excel Formulas / Excel Shortcut When Using Dates as Formula Criteria
Excel Shortcut When Using Dates as Formula Criteria
February 13, 2013 by Mynda Treacy

Working with Dates in Excel can be frustrating because a date criteria in one formula doesn’t always work in another.

Using the data below let’s say we want to summarise units sold by Product for January.

Excel SUM using Date as criteria

Note: the data above is formatted as a Table which means we can use Structured References in our formulas instead of cell ranges. Click here to read how Structured References work.

Below are 5 different formulas that all summarise the data in our table based on the criteria in column B and the date in Column A.

Excel SUM using Date as criteria

Notice the different ways the Date criteria is entered in each formula?

Let’s look at the pros and cons for each one.

1. SUMIFS Formula with Fixed Dates

=SUMIFS(Table1[Units],Table1[Product],E2,Table1[Date], ">=1/01/2013",Table1[Date],"<=31/01/2013")

Pros:

  • SUMIFS is an easy formula to use.

Cons:

  • Dates are hard keyed which means the formula isn’t dynamic. Formula # 2 is better.
  • If you only have Excel 2003 then you don’t have the SUMIFS Function. Use options 3, 4 or 5 instead.

2. SUMIFS Formula with Dynamic Date Reference

=SUMIFS(Table1[Units],Table1[Product],E3,Table1[Date],">="&$F$1,Table1[Date],"<="&EOMONTH($F$1,0))

Pros:

  • Same as formula # 1 plus the date criteria is linked to a cell which means if the cell changes you don’t need to change the formula, and if you want to summarise February, March.... you can simply insert columns beside F and copy the formula across without having to update it.

Cons:

  • SUMIFS isn’t available in Excel 2003.

3. SUMPRODUCT Formula with Fixed Dates

=SUMPRODUCT(Table1[Units]*(Table1[Product]=E4)*(Table1[Date] >=DATEVALUE("1/1/2013"))* (Table1[Date]<=DATEVALUE("31/1/2013")))

Pros:

  • SUMPRODUCT works in Excel 2003 onwards

Cons:

  • Hard keyed date means it’s not dynamic.
  • Need to use the DATEVALUE function for Excel to interpret the date criteria correctly.

4. SUM array formula

{=SUM(Table1[Units]*(Table1[Product]=E5)*(TEXT(Table1[Date],"mmm-yy")=$F$1))}

Pros:

  • This array formula works in Excel 2003 onwards
  • Dynamic date reference to cell F1
  • Only one date criteria is required. Using TEXT(Table1[Date],"mmm-yy") tells Excel to find all dates for the month of Jan-13 so we don’t need to specify ">=1/01/2013" and "<=31/01/2013".

Cons:

  • It’s an array formula which means it’s not the most efficient formula, plus some people don’t understand how array formulas work so it is susceptible to human error.
  • We need to enter the date in cell F1 as text. See how the date in the formula bar below is preceded by an apostrophe, yet in the cell you can’t see it. This apostrophe forces Excel to interpret the value as text.

Excel SUM using Date as criteria

What is interesting is this format works in all of the above formulas, but if you were to enter the date like this: 1/01/2013 and format it as mmm-yy using cell formats, then formulas 4 and 5 don’t work – see below:

Excel SUM using Date as criteria

5. SUMPRODUCT Formula

=SUMPRODUCT(Table1[Units],(Table1[Product]=E6)*(TEXT(Table1[Date],"mmm-yy")=$F$1))

Pros:

  • Works in Excel 2003 onwards.
  • Dynamic date reference to cell F1.
  • Only one date criteria is required like the SUM array formula above.
  • It’s not an array formula.

Cons:

  • Requires the date in cell F1 to be entered as text.

The downside with formatting the date criteria as text is you can’t use AutoFill because Excel doesn’t recognise the series.

However if it’s something you’re going to use regularly you can set up a custom AutoFill list.

Excel 2007 > Windows button > Excel Options > Popular > ‘Edit Custom Lists’ > Add a new list

Excel 2010 > File tab > Options > Advanced > General > ‘Edit Custom Lists’ > Add a new list.

Excel SUM using Date as criteria

Now when you type in the first two months from your series you can use the AutoFill button to drag and fill the remaining dates.

Excel SUM using Date as criteria

Excel SUM using Date as criteria

A special thanks to Martin Cronin for sharing his TEXT(Table1[Date],"mmm-yy")=$F$1) trick with me.

If you liked Martin's tip please show your appreciation by sharing it using the social media links below.

Excel Shortcut When Using Dates as Formula Criteria
Mynda Treacy

Microsoft MVP logo

AUTHOR Mynda Treacy Co-Founder / Owner at My Online Training Hub

CIMA qualified Accountant with over 25 years experience in roles such as Global IT Financial Controller for investment banking firms Barclays Capital and NatWest Markets.

Mynda has been awarded Microsoft MVP status every year since 2014 for her expertise and contributions to educating people about Microsoft Excel.

Mynda teaches several courses here at MOTH including Excel Expert, Excel Dashboards, Power BI, Power Query and Power Pivot.

More Excel Dates Posts

SUMIFS Formula Referencing Cells Containing Dates

SUMIFS Formula Referencing Cells Containing Dates

More Sumif Posts

More Sumifs Posts

More Sumproduct Posts

More Excel Formulas Posts

Summarize Months to Quarters

Excel Formulas to Summarise Monthly Data into Quarters

3 ways (good, better, best) to summarize monthly data into quarters using formulas. Lots of examples and sample file to download.
Excel BYROW and BYCOL Functions

Excel BYCOL and BYROW Functions

Excel BYCOL and BYROW functions fundamentally change the way we write formulas that calculate across columns and down rows.
python in excel natively

How to Use Python in Excel Natively

How to use Python in Excel natively using libraries like Pandas, NumPy, Matplotlib, Seaborn and more for analysis and spectacular charts!
excel dynamic named ranges

Excel Dynamic Named Ranges

Excel Dynamic Named Ranges update automatically to include new data in the ranges referenced in your formulas and PivotTables etc.
functions for financial modelling

Excel Functions for Financial Modeling

Top 23 must know Excel functions for Financial Modeling. Includes example Excel file and step by step instructions.
excel formula by example

Excel Formula by Example

Excel can now write a formula by example. Simply give it an example or two of the result and Excel will write the formula.
ai-aided excel formula editor

AI Aided Excel Formula Editor

Save time with this free AI Excel formula editor add-in that writes, edits, improves and interprets formulas for you!
top excel functions for data analysts

Top Excel Functions for Data Analysts

Must know Excel Functions for Data Analysts and what functions you don’t have to waste time learning and why.
excel advanced formula environment

Excel Labs (Formerly, Advanced Formula Environment)

Excel Labs is a long awaited, new improved way to write, name and store Excel formulas, including LAMBDAS with the help of AI.
Pro Excel Formula Writing Tips

Pro Excel Formula Writing Tips

Must know Excel formula writing tips, tricks and tools to make you an Excel formula ninja, including a new formula editor.


Category: Excel FormulasTag: excel dates, sumif, sumifs, sumproduct
Previous Post:Excel Ignore Blanks in Data Validation ListExcel Ignore Blanks in Data Validation List
Next Post:Excel Surveys (Forms) an Easy Way to Collect DataExcel Surveys an Easy Way to Collect Data

Reader Interactions

Comments

  1. Francis Franco

    February 16, 2013 at 5:49 am

    I am having problem with this [Item] in your formula under Excel Shortcut
    when using Dates as Formula Criteria because it has show me 0
    This is your formula as follow:
    =sumifs(Table1[Units],Table1[Item???],E2,Table1[Date],”>=1/01/2013″,Table[Date],”<=31/01/2013')
    When I use [Product] instead of your what is this [Item] in my formula,this is still show nothing neither. Can you show me where this[Item] represent??

    Reply
    • Carlo Estopia

      February 16, 2013 at 2:10 pm

      Hi Francis,

      Greetings.

      Yes, It should have been a Product.
      However, We may be experiencing the same problem because the
      available date formats in my Excel doesn’t have a format date
      the same as in our example.

      So what you want to do is change [Item] to [Product],
      and Make sure your Dates in the formula and your Date Formats
      in your table are the same.

      So In my case the date format in my table is m/d/yyyy i.e. 2/1/2013.
      So Change the formula like this

      =SUMIFS(Table1[Units],Table1[Product],E2,Table1[Date],">=2/1/2013",Table1[Date],"<=2/1/2013")
      

      ALSO: Make sure you put a criteria in E2. Say "Goggles"

      Hopefully.... I'm sure you'll get results.

      Read More on : SUMIFS
      Tables

      Cheers.

      CarloE

      Reply
  2. Kris

    February 15, 2013 at 6:28 am

    Thank you Mynda for the great comparision of the techniques!

    I’d like to add one thing could be important for those who use non-english regional settings in Windows.
    Most of the above mentioned formulas will not work in non-english environment, because date format, date separator character and the string parameter of TEXT formula is different. In international environment better to avoid these kind of string constants.

    We described the problem of TEXT formula here:
    https://sites.google.com/site/e90e50fx/home/funzioni-excel-con-argomenti-costituiti-da-valori-di-testo-seconda-parte/excel-functions-with-text-value-arguments-second-part

    Cheers,
    Kris

    Reply
    • Mynda Treacy

      February 15, 2013 at 9:01 am

      Hi Kris,

      Great points. Thanks for sharing 🙂

      Mynda.

      Reply

Leave a Reply Cancel reply

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

Current ye@r *

Leave this field empty

Sidebar

More results...

Popular Content

  • 10 Common Excel Mistakes to Avoid
  • Top Excel Functions for Data Analysts
  • Secrets to Building Excel Dashboards in Less Than 15 Minutes
  • Pro Excel Formula Writing Tips
  • Hidden Excel Double-Click Shortcuts
  • Top 10 Intermediate Excel Functions
  • 5 Pro Excel Dashboard Design Tips
  • 5 Excel SUM Function Tricks
  • 239 Excel Keyboard Shortcuts

100 Excel Tips and Tricks eBook

Download Free Tips & Tricks

239 Excel Keyboard Shortcuts

Download Free PDF

mynda treacy microsoft mvpHi, I'm Mynda Treacy and I run MOTH with my husband, Phil. Through our blog, webinars, YouTube channel and courses we hope we can help you learn Excel, Power Pivot and DAX, Power Query, Power BI, and Excel Dashboards.

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.

Download A Free Copy of 100 Excel Tips & Tricks

excel tips and tricks ebook

We respect your privacy. We won’t spam you.

x