Question: How do I count the number of unique months in excel?

Answer:

count-unique-distinct-months

Array formula in C17:

=SUM(IF(MATCH(DATE(YEAR(List), MONTH(List), 1), DATE(YEAR(List), MONTH(List), 1), 0)=ROW(List)-MIN(ROW(List))+1, 1, 0)) + CTRL + SHIFT + ENTER

Named ranges
List (A2:A15)
What is named ranges?

How to customize the formula to your excel spreadsheet
Change the named range.

Download excel sample file for this tutorial.
Count unique distinct months.xls
(Excel 97-2003 Workbook *.xls)

Functions in this article:

IF(logical_test;[value_if:true];[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE

MATCH(lookup_value;lookup_array; [match_type]
Returns the relative position of an item in an array that matches a specified value

DATE(year,month,day) returns the number that represents the datein Microsoft Office Excel date-time code

MONTH(serial_number) returns the month, a number from 1 (January) to 12 (December)

YEAR(serial_number) returns the year of a date, an integer of the range 1900-9999

SUM(number1,[number2],)
Adds all the numbers in a range of cells

MIN(number1,[number2])
Returns the smallest number in a set of values. Ignores logical values and text

This blog article is one out of twelve articles on the same subject "count unique and unique distinct".

  • Share/Bookmark

Related posts:

  1. Count unique and unique distinct values in a multicolumn range in excel
  2. Count unique distinct values in two columns with date criteria in excel
  3. Count unique values and unique distinct values in two ranges combined
  4. Count unique distinct values in three columns combined in excel
  5. Count unique values and unique distinct values in three ranges combined in excel
  6. Count unique distinct values in two columns in excel
  7. Count unique distinct values in a column in excel
  8. Create unique distinct year and months from a long date listing in excel
  9. How to calculate missing months in a given date range in excel
  10. Count unique distinct records in a date range and a numeric range in excel