Question: I have two columns of data... A1-A10 contain a list of dates.

B1-B10 contain a value, AA, BB, CC, AA, DD, CC, etc.

I would like to count how many times each value in the B column occures in the
sheet, but only if it has occured in the past 90 days.

How would I do this?



Formula in A16:

=INDEX(Rng1, MATCH(0, COUNTIF($A$15:A15, Rng1), 0)) + CTRL + SHIFT + ENTER

copied down as far as necessary.

Formula in B16:

=SUM(COUNTIF(A16, IF(Dts1>$B$13, Rng1, ""))) + CTRL + SHIFT + ENTER

copied down as far as necessary.

Download excel file.
Calculate occurences in the past 90 days.xl

(Excel 97-2003 Workbook *.xls)

Functions in this article:

Adds all the numbers in a range of cells

Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE

Counts the number of cells within a range that meet the given condition

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

Returns a value or reference of the cell at the intersection of a particular row and column, in a given range