I took the liberty of "explaining" to myself the purpose of each section of this formula. Do you think this is a correct assessment?
More or less, though the SUMPRODUCT formula probably needs a little more explaining. Let's break it down by the three parts:
--(MONTH(A$2:A$100)=MONTH(A2))
This goes through each row (A2:A100), and checks to see if the Month of that date is equal to the Month in cell A2. If it is, it returns True, else False.
--(YEAR(A$2:A$100)=YEAR(A2))
This goes through each row (A2:A100), and checks to see if the Year of that date is equal to the Year in cell A2. If it is, it returns True, else False.
--(B$2:B$100)
This returns the amount from column B
So, for any row, it goes through all lines of data in our range (rows 2-100), and adds up the values in column B where our first two checks are TRUE.
Does that make sense?
Since the cell references are not absolute, it is "copyable", this is good. However, it doesn't work for my data I replaced the array references with named arrays, and the logical test works, but the whole formula together gives me "#value!"
What am I still doing wrong?
Two possibilities.
Are all of your ranges the exact same size?
Note that the three parts of the SUMPRODUCT all have the same number of rows (99). They have to in order to work together. If one of your named references contains a different number of rows OR columns that another one, it will not work.
Are the dates in column A entered as Dates or Text? They must be entered as Dates.
Here is a simple test to find out. If the following formula for any date cell returns FALSE, it is Text and not a Date.
=ISNUMBER(A2)
If you are still having trouble, post your formula, exactly as you have written it, and also post what each of your named ranges represent (what is the date range that they make up).