=SUM(IF(FREQUENCY(IF('Resident Worker Hour Report'!$A$19:$A$400=$D143,IF('Resident Worker Hour Report'!$B$19:$B$400=$B143,IF('Resident Worker Hour Report'!$K$4:$DY$4=E$139,IF('Resident Worker Hour Report'!$K$19:$DY$400<>"",MATCH('Resident Worker Hour Report'!$D$19:$D$400&'Resident Worker Hour Report'!$C$19:$C$400,'Resident Worker Hour Report'!$D$19:$D$400&'Resident Worker Hour Report'!$C$19:$C$400,0))))),ROW('Resident Worker Hour Report'!$A$19:$A$400)-ROW('Resident Worker Hour Report'!$A$19)+1),1))
Just pressing F9 is not working for me though