So I have this Sumproduct formula looking at sheet called ZHFM :
=SUMPRODUCT((ZHFM!$D$2:$D$10000=LEFT($C$5;5))*(ZHFM!$A$2:$A$10000=$D25)*(ZHFM!$AE$2:INDEX(ZHFM!$AF$2:$AQ$10000;;MATCH(L$5;ZHFM!$AF$1:$AQ$1;0))))
Now I also want to use this formula on another tab calles ZHFMLY. So I copied it and changed for all instances ZFHM to ZHFMLY :
=SUMPRODUCT((ZHFMLY!$D$2:$D$10000=LEFT($C$5;5))*(ZHFMLY!$A$2:$A$10000=$D25)*(ZHFMLY!$AE$2:INDEX(ZHFMLY!$AF$2:$AQ$10000;;MATCH(F$5;ZHFMLY!$AF$1:$AQ$1;0))))
But for some reason the new formula gives me an #N/A error, but there is data it should pick up.

Before I changed ZHFM to ZHFMLY the copied formula gave me data, but obviously from a different sheet.
But the data on the ZHFMLY sheet is good.

I am not familiar with this sumproduct formula so if anybody could explain to me what is going on I would be gratefull.