Question:

I have a table with four columns, Date, Name, Level, and outcome. The range is from row 3 to row 1000.

What I need to be able to do is look at today's date. Determine the month and year and then look up all the values in the date column that match the month and year. I've been trying to get it to work with sumproduct but I can't wrap my head around it.

Then on a separate tab list all the unique events for that month.
So one the seperate tab it would show something like this:

May 2/2010 Bob Smith 3 Requires Attention
May 5/2010 Jim Smith 1 Out of Service

Hope you are able to help. Thanks in advance.

Question found here

Answer:

Match year and month

Array formula in A15:

=INDEX($A$5:$D$9, SMALL(IF(TEXT($B$2, "yyyy-mmm")=TEXT($A$5:$A$9, "yyyy-mmm"), ROW($A$5:$A$9)-MIN(ROW($A$5:$A$9))+1, ""), ROW(A1)), COLUMN(A1)) + CTRL + SHIFT + ENTER.

Copy cell and paste it to the right to D15. Copy A15:D15 and paste it down as far as needed.

List all the unique events for that month

Array formula in A24:

=INDEX($A$5:$D$9, SMALL(IF(TEXT($B$2, "yyyy-mmm")=TEXT($A$5:$A$9, "yyyy-mmm"), IF(MATCH($B$5:$B$9&$C$5:$C$9&$D$5:$D$9, $B$5:$B$9&$C$5:$C$9&$D$5:$D$9, 0)=ROW($A$5:$A$9)-MIN(ROW($A$5:$A$9))+1, ROW($A$5:$A$9)-MIN(ROW($A$5:$A$9))+1, ""), ""), ROW(A1)), COLUMN(A1))

Copy cell and paste it to the right to D24. Copy A24:D24 and paste it down as far as needed.

Download excel example file.

list all the unique events for a specific month.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

INDEX(array,row_num,[column_num])
Returns a value or reference of the cell at the intersection of a particular row and column, in a given range

SMALL(array,k) Returns the k-th smallest row number in this data set.

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

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

ROW(reference) returns the rownumber of a reference

COLUMN(reference)
returns the column number of a reference

TEXT(value, format_text)
Converts a value to text in a specific number format