Note: The other languages of the website are Google-translated. Back to English

How to Countif by date/month/year and date range in Excel?

For example, we have a membership roster with their birthdays, and now we are preparing to make birthday cards for these members. Before making the birthday cards, we have to count how many birthdays are in a specific month/year/date. Here I will guide you to Countif by date/month/year and date range with formulas in Excel with following methods:


Countif by specific month/year and date range with formulas in Excel

In this section, I will introduce some formulas to count birthdays by a certain month, year, or date range in Excel.

Countif by a certain month

Supposing you are going to count birthdays which are in a specific month of 8, you can enter below formula into a blank cell, and then press the Enter key.

=SUMPRODUCT(1*(MONTH(C3:C16)=G2))

Notes:

In above formula, C3:C16 is the specified Date of Birth column you will count birthdays in, and G2 is the cell with the specific month number.

You can also apply this array formulas =SUM(IF(MONTH(B2:B15)=8,1)) (press Ctrl + Shift + Enter keys) to count birthdays by the specific month.

Countif by a certain year

If you need to count the birthdays by a certain year, says 1988, you can use one of below formulas as you need.

=SUMPRODUCT(1*(YEAR(C3:C16)=1988))
=SUM(IF(YEAR(B2:B15)=1988,1))

Note: The second formula an array formula. Please remember to press the Ctrl + Shift + Enter keys together after entering the formulas;

Countif by a certain date

If you need to count by a specific date (says 1992-8-16), please apply below formula, and press the Enter key.

=COUNTIF(B2:B15,"1992-8-16")

Countif by a certain date range

If you need to count if later/earlier than a specific date (says 1990-1-1), you can apply the below formulas:

=COUNTIF(B2:B15, ">" & "1990-1-1")
=COUNTIF(B2:B15, "<" & "1990-1-1")

To count if between two specific dates (says between 1988-1-1 and 1998-1-1), please apply below formula:

=COUNTIFS(B2:B15,">"&"1988-1-1",B2:B15,"<"&"1998-1-1")

note ribbon Formula is too complicated to remember? Save the formula as an Auto Text entry for reusing with only one click in future!
Read more…     Free trial

Easily count by Fiscal year, half year, week number, or day of week in Excel

The PivotTable Special Time Grouping feature, provided by Kutools for Excel, is able to add a helper column to calculate the fiscal year, half year, week number, or day of week based on the specified date column, and let you easily count, sum, or average columns based on the calculated results in a new Pivot Table. Full Feature Free Trial 30-day!

Kutools for Excel - Includes more than 300 handy tools for Excel. Full feature free trial 30-day, no credit card required! Get It Now

Countif by specified date, year, or date range in Excel

If you have Kutools for Excel installed, you can apply its Select Specific Cells utility to count the number of occurrences by specified date, year, or date range in Excel easily.

Kutools for Excel- Includes more than 300 handy tools for Excel. Full feature free trial 30 days, no credit card required! Get It Now

1. Select the birthday column you will count in, and click Kutools > Select > Select Specific Cells. See screenshot:

2. In the opening Select Specific Cells dialog box, please do as above screenshot shown:
(1) In the Selection type section, please check one option as you need. In our case, we check the Cell option;
(2) In the Specific type section, select the Greater than or equal to from the first drop down list, and then type the first date of the specified date range in right box; next select the Less than or equal to from the second drop down list, and type the last date of the specified date range in right box, and then check And option;
(3) Click the Ok button.

3. Now a dialog box pops out and shows how many rows have been selected as below screenshot shown. Please click the OK button to close this dialog box.

Notes:
(1) For counting the number of occurrences by specified year, just specified the date range from the first date of this year to the last date of this year, such as from 1/1/1990 to 12/31/1990.
(2) For counting the number of occurrences by specified date, such as 9/14/1985, just specify the settings in the Select Specific Cells dialog box as below screenshot shown:


Demo: Countif by date,weekday, month, year, or date range in Excel


Kutools for Excel includes more than 300 handy tools for Excel, free to try without limitation in 30 days. Download and Free Trial Now!

Related articles:


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (30)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi I am trying to use a formula to count how many dates are passed a changing date, e.g TODAY()-330. I need this to continue to change as it is for expiring training courses What I have been using is =COUNTIFS(C3:C28,"
This comment was minimized by the moderator on the site
=COUNTIF('[report1623994260364.csv]18Jun'!$E$2:$E$774,MONTH('[report1623994260364.csv]18Jun'!$F$2:$F$774=Y11))What is wrong with the above command, I am trying to count column E, provided Column F has values = Y11
This comment was minimized by the moderator on the site
I am using =COUNTIFS(E2:E900,">"&"6/1/2015",E2:E900,"
This comment was minimized by the moderator on the site
I'm trying to create a table that counts the number of times a device has been used each month from another table which shows the date in cell a and then in cell b,c,d is a 1 if that device is being used on that date. So, on Sheet 2, is a table with Date (A1) Device 1 (B1) Device 2 (C1) Device 3 (D1). I would enter the date 01/01/16 in cell A1 and lets say Device 3 is being used so I would put a '1' in cell D1. on 02/01/16 device 2 is used so I would enter the date and put a '1' in cell C1. So on and so forth. On Sheet 1, is a summary table which tells me how many times Device 1 has been used each month. So, in A2 I have the Month 'January', A3 'February' etc, in cell B2, Device 1, Cell C2, Device 2 etc. I want a total count. Is that possible?
This comment was minimized by the moderator on the site
I WANT ANSWER 1 DAY( WITH EXAMPLE FORMULA) COUNT BETWEEN :- 01/01/2004 TO 01/01/2004 = 1 DAY WHICH FORMULA WILL APPLY
This comment was minimized by the moderator on the site
=A2-A1+1
OR
=END DATE - START DATE + 1
This comment was minimized by the moderator on the site
=SUMPRODUCT(1*(MONTH(B2:B15)=8))

I need to add 'exclude blank cells', please help.
This comment was minimized by the moderator on the site
Hi jimmy,
Blank cells won’t affect the calculation result of this formula =SUMPRODUCT(1*(MONTH(B2:B15)=8))
This comment was minimized by the moderator on the site
i have on sheet where in daily sales add in a single day
08-Feb-18 AMIT SHARMA
08-Feb-18 AVINASH KUMAR
08-Feb-18 SANJAY SEHGAL
09-Feb-18 hay
09-Feb-18 ravi

but i need on second sheet
08-Feb-18 3
09-Feb-18 2

so pleaase tell me farumula for this counts total sales at other sheet
This comment was minimized by the moderator on the site
Hi Deepak,
Just add the sheet name before referenced cells. For example your data is in Sheet1, and you want to count the sales in Feb, you can modify the formula as =SUMPRODUCT(1*(MONTH(Sheet1!B2:B15)=2))
This comment was minimized by the moderator on the site
Yes, they do - Excel rounds blank cells to January 0, 1900 - therefore when I'm trying to count January months over a set range that has not been filled in yet - I'm getting a higher number for January due to this.
This comment was minimized by the moderator on the site
in Excel 2103 I have a long list of date and times, i am trying to calculate the number between each half hour, e.g. 8am and 8.30am on each date. Can you assist?
This comment was minimized by the moderator on the site
Hi Willie,
You can do as follows:
(1) Add a new column and round time data to half hour by the formula =MOD(INT(A2/(1/48))*(1/48),1) (A2 is the time cell)
(2) Select the data range including the new column, create a pivot table.
(3) In the PivotTable Fields pane, set date and the new half hour as Row fields, set the data you will sum or count as Value field.
(4) Turn off the grouping in the PivotTable.
This comment was minimized by the moderator on the site
I have a monthly report but need to count only daily data. I don't know to use Today option if formula is =COUNTIF(A1:A50,"RR")=TODAY(). Please help
This comment was minimized by the moderator on the site
Hi IvTe,
Do you need to count data meeting two conditions? You can use the COUNTIFS function.
This comment was minimized by the moderator on the site
Thank you!
This comment was minimized by the moderator on the site
rumus ini = SUMPRODUCT (1 * (YEAR (B2: B15) = 1988)) kalau datanya (range) sampe 20ribu ko ga bisa ya?
This comment was minimized by the moderator on the site
How can I count a cell on a specific day of the week. For example, I want to find a number of something on the first Sunday of the month
This comment was minimized by the moderator on the site
Hi mary,
In your case, you should count by the specified date. For example, count by the first Sunday of Jan, 2019 (in other words 2019/1/6), you can apply the formula =COUNTIF(E1:E16,"2019/1/6")
This comment was minimized by the moderator on the site
JAN = 1
FEB = 2
..
..
DEC = 12 ? NOT CORRECT RESULT IN DECEMBER
This comment was minimized by the moderator on the site
Hi Rhon,
Could you describe more about the error? Does the error come out when converting December to 12, or when counting by “12”?
This comment was minimized by the moderator on the site
What would you do if you have 1 column of events within a date range and need to count if those events had a date in another column?

Example: I have column B as the event dates which vary each month. Column D has the date they came into a consultation. I'm trying to count how many people from that specific event for a date range came to a consultation for any date.
This comment was minimized by the moderator on the site
Hi Roxie,
You should try the Compare cells feature, which can compare two columns of cells, find out, and highlight the exactly same cells between them or the differences. https://www.extendoffice.com/product/kutools-for-excel/excel-compare-two-cells-of-equal.html
This comment was minimized by the moderator on the site
Why we cant justselect whole column, instead of using this MONTH(C3:C16) ?
This comment was minimized by the moderator on the site
In the formula =SUMPRODUCT(1*(MONTH(C3:C16)=G2)), G2 is the specified month number, says 4. If we replace MONTH(C3:C16) with the whole columns (or C3:C16), there is no value that equal to the value 4, therefore we cannot get the count result.
This comment was minimized by the moderator on the site
i need report weekly wise like a 7th 14th 21st 28th count only.other days are no need for every month i tried many pivot but i can't find out please help me.
This comment was minimized by the moderator on the site
01/03/2022 27/08/2022
02/02/2022 31/07/2022
01/04/2022 01/07/2022
01/04/2022 30/06/2022
01/04/2022 30/06/2022
30/04/2022 29/05/2022
20/04/2022 19/05/2022
15/04/2022 14/05/2022
15/04/2022 14/05/2022
15/04/2022 14/05/2022
04/04/2022 03/05/2022
01/02/2022 01/05/2022
13/04/2022 27/04/2022
16/04/2022 24/04/2022
04/04/2022 23/04/2022
15/04/2022 20/04/2022
21/03/2022 19/04/2022
11/04/2022 17/04/2022
05/04/2022 14/04/2022
15/03/2022 13/04/2022
15/03/2022 13/04/2022
15/03/2022 13/04/2022
15/03/2022 13/04/2022
15/03/2022 13/04/2022
15/03/2022 13/04/2022
15/03/2022 13/04/2022
15/03/2022 13/04/2022
15/03/2022 13/04/2022
22/03/2022 10/04/2022
27/03/2022 05/04/2022
29/03/2022 04/04/2022
03/01/2022 03/04/2022
03/01/2022 03/04/2022
03/01/2022 03/04/2022
25/03/2022 03/04/2022

Como contar apenas os dias do mês 04 nesses intervalos?
This comment was minimized by the moderator on the site
Hi, are you trying to count the number of days in April?
If yes, you should first select the two columns, then go to Kutools tab, in the Ranges & Cells group, click To Actual. Now, in the Editing group, click Select, and then click Select Specific Cells.
In the pop-up dialog box, select Cell option under the Selction Type; Under Specific type, select Contains, and type 4/2022 in the corresponding box. Click OK. Now, it will tell you how many days of April are there. Please see screenshot.
This comment was minimized by the moderator on the site
Προσπαθω να μετρήσω μια σιγκεκριμένη ημερομηνία αλλα τον τυπο που έχεται παραπάνω δεν το δέχεται το excel =COUNTIF(B2:B15,"1992-8-16")
This comment was minimized by the moderator on the site
Hi there,

Is it becase of the language your Excel version? Please check if COUNTIF should be converted to your language in your Excel verion. Also, when you say Excel does not accept the formula, did Excel show any errors or anything?

Amanda
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations