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. Create unique distinct year and months from a long date listing in excel
  2. Count unique distinct records in a date range and a numeric range in excel
  3. How to calculate missing months in a given date range in excel
  4. Count unique distinct values using date criteria in a range in excel
  5. Count unique distinct values within same week, month or year in excel
  6. How to count unique distinct occurrences for each date in excel
  7. Highlight odd/even months using conditional formatting in excel 2007
  8. Unique distinct list from a column sorted A to Z using array formula in excel
  9. Unique distinct list sorted based on occurrance in a column in excel