Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to conditionally sum numeric data in an Excel table using SUMIFS
  • Move chart to a separate worksheet in Excel
  • Remove Duplicates Example in Excel
  • Example of COUNTIFS with variable table column in Excel
  • Conditional Formatting New Rule with Formulas in Excel

References

  • Merge tables with VLOOKUP in Excel
  • How to use Excel MATCH Function
  • How to get last row in mixed data with blanks in Excel
  • Convert text string to valid reference in Excel using Indirect function
  • How to use Excel VLOOKUP Function

Data Validations

  • Excel Data validation require unique number
  • Prevent invalid data entering in specific cells
  • Excel Data validation only dates between
  • Excel Data validation must not contain
  • Excel Data validation no punctuation

Count dates in current month in Excel

by

This tutorial shows how to Count dates in current month in Excel using example below.

To count dates in the current month, you can use a formula based on the COUNTIFS or SUMPRODUCT function as explained below.

Formula

=COUNTIFS(range,">="&EOMONTH(TODAY(),-1)+1,
range,"<"&EOMONTH(TODAY(),0)+1)

Explanation

In the example shown above, the formula in E7 is:

=COUNTIFS(dates,">="&EOMONTH(TODAY(),
-1)+1,dates,"<"&EOMONTH(TODAY(),0)+1)

Where “dates” is the named range B5:B104.

How this formula works

At the core, this formula uses the COUNTIFS function to count dates in a range when the are greater than or equal to the first day of the current month, and less than the first day of the next month. The EOMONTH function is used to create both dates based on the current date, which is supplied by the TODAY function.

To get the first day of the month, we use:

EOMONTH(TODAY(),-1)+1

Here, the EOMONTH function returns the last day of the previous month, to which 1 is added to get the first day of the current month.

To get the last day of the current month, EOMONTH is used like this:

EOMONTH(TODAY(),0)+1

EOMONTH returns the last day of the current month, to which 1 is added to get the first day of the next month.

To count dates in the previous month:

=COUNTIFS(dates,">="&EOMONTH(TODAY(),-2)
+1,dates,"<"&EOMONTH(TODAY(),-1)+1)

To count dates in the next month:

=COUNTIFS(dates,">="&EOMONTH(TODAY(),0)
+1,dates,"<"&EOMONTH(TODAY(),1)+1)

SUMPRODUCT alternative

You can also count dates in the previous, current, and next month using SUMPRODUCT like this:

=SUMPRODUCT(N(TEXT(EOMONTH(TODAY(),-1),
"mmyy")=TEXT(range,"mmyy")))
=SUMPRODUCT(N(TEXT(TODAY(),"mmyy")=
TEXT(range,"mmyy")))
=SUMPRODUCT(N(TEXT(EOMONTH(TODAY(),1),
"mmyy")=TEXT(range,"mmyy")))

Here, dates are fed into the TEXT function to get a month and year string, which is used for comparison in an array operation inside SUMPRODUCT. The result is an array of TRUE FALSE values, where TRUE represents dates in the month of interest.

The N function is used to change these values to ones and zeros, and SUMPRODUCT simply sums and returns the array.

Post navigation

Previous Post:

DECIMAL function: Description, Usage, Syntax, Examples and Explanation

Next Post:

AVERAGE function: Description, Usage, Syntax, Examples and Explanation

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

Logical Functions

  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • How to return blank in place of #DIV/0! error in Excel
  • Not Equal To ‘<>‘ operator in Excel
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • Return blank if in Excel

Date Time

  • How to show last updated date stamp in Excel
  • Calculate date overlap in days in Excel
  • Convert text date dd/mm/yy to mm/dd/yy in Excel
  • Display Date is workday in Excel
  • Get age from birthday in Excel

Grouping

  • How to randomly assign data to groups in Excel
  • Group times into 3 hour buckets in Excel
  • Group arbitrary text values in Excel
  • Map inputs to arbitrary values in Excel
  • Calculate conditional mode with criteria in Excel

General

  • Transpose: Switch ‘Rows to Columns’ or ‘Columns to Rows’ in Excel
  • How to count total number of cells in a rectangular range in Excel
  • AutoRecover file that was never saved in Excel
  • Lock Cells in a Worksheet Excel
  • How to generate random number weighted probability in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning