Excel/countif of dates


I am using Excel 2010.
I have a two column table of orders.
In column A - the date
In column B - the number of orders that were order in that date.
For example:
26/1/2015 - 6
27/1/2015 - 3

I wish to count all the order per each month.
Please advise.

ANSWER: You would use COUNTIFS() instead as that would allow you to designate multiple criteria.

=COUNTIFS(A:A, ">=1/1/2015", A:A:, "<1/2/2015")

I would be remiss if I did not point out that a Pivot Table would be the more perfect solution as it is inherently capable of grouping table results by month.


---------- FOLLOW-UP ----------

QUESTION: Thanks for your reply Jerry.
In column A I have many more dates, of many months.
Your formula covers only January 2015.
How can I cover all the year?

Back to the COUNTIFS() suggestion, as per your example I demonstrated ONE formula for one specific month.  You would create a different formula for the next month, and so on.

You could put the starting date of a given month in a cell, then use that as a reference for a more self-adjusting formula.  So perhaps you put Jan 1, 2015 in M2, then in N2 you could put:

=COUNTIFS(A:A, ">="&M2, A:A, "<="&EOMONTH(M2,0))

Then put sequential starting dates in M3, M4, copy down as far as needed, then just copy the N2 formula down.

I would be remiss if I did not again point you to the Pivot Table which does ALL of this and more with minimal effort right out of the box.  If you've never played with Pivot Tables before it worth the small amount of time it takes to get comfortable with all the controls.  Do it.  You will not be sorry, your Excel life will forever improve and simplify.

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Jerry Beaucaire


Excel Formulas, macros, automation. Microsoft Excel MVP - 2010. Code site with free code snippets and techniques: http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/files


Microsoft Excel MVP - 2010. I have my own extensive Excel help/code site: http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/files ===================== I have been offering free assistance as an Excel aid on many web sites for many years: (http://www.excelforum.com - JBeaucaire) ======== (http://www.askmehelpdesk.com/spreadsheets - JBeaucaire) ======= (http://www.mrexcel.com/forum - jbeaucaire)

Bachelor's Degree from Azusa Pacific University in Mathematics and Music Composition

Awards and Honors
Microsoft Excel MVP 2010

©2016 About.com. All rights reserved.