In case anyone is interested, this is the formula I used (a colleague helped me):
=IF(AND(Richmond!$D6=B$5,OR(DATEVALUE(Richmond!B6)=EOMONTH(TODAY(),-1)+1,DATEVALUE(Richmond!B6)=EOMONTH(TODAY(),-2)+1,DATEVALUE(Richmond!B6)=EOMONTH(TODAY(),-3)+1)),Richmond!E6,0)