I have the following formula:

=AVERAGE(IF('All Employee Hourly'!$D$6:$D$24986 =E36,'All Employee Hourly'!$L$6:$L$24986),0)

the formula looks a cell E36 and is supposed to return an average of column L from all cells that match value of E36. The problem is that is not returning the correct value. I tested the formula, and one of the values only repeats once on the referenced table so it should have returned the exact value, however, it did not.

I am missing something?