Code:
=MAX(IF((MONTH(dates)=MONTH(A1029))*(YEAR(dates)=YEAR(A1029));FXRJY;0))
Ctrl+shift+enter instead of enter.

Where dates is a column of dates and FXRJY is a column of value. A1029 is a date with the wanted month and year, for example 1/1/1998.