Hi benishiryo,
Just found out that the formula does not get result when qty does not match. Please take a look at cell W3 and W16 in attahcced file.

Regards,
tt3