Here is the SUMPRODUCT function taking account of the year as suggested by Villeroy
=IF(MONTH(A4)<>MONTH(A5);SUMPRODUCT(MONTH(A$2:$A$700)=MONTH(A4);$B$2:$B$700;YEAR(A$2:A$700)=YEAR(A4));"")
It can not work with an empty string.
Probably I missed something, but where is the empty string?
The sum of the products in Z2:Z700 gives the same result as the above suggested SUMPRODUCT
Yes, but only if the "IF test" is omitted.
PS:@Villeroy: I know I can be a pain in the ass, but hopefully no hard feelings.
LibreOffice 4.0.5 on OpenSuse 12.3/64bit/KDE4.10 (Version from the TDF page) + LibreOffice 4.1.1 on Debian Wheezy/64bit/KDE4.8 + LibreOffice 4.1.1 on Win7/64bit