=SUMPRODUCT(('Master log'!K:K>'Master log'!L:L)*('Master log'!D:D="HJT"))
Then just switch the sign from > to < for the second formula. One should have an = after the sign to take care of that contingency.
For the second formula, if the first is in A1 on it's sheet, you could also do =Countif('Master log'!D:D,"HJT")-A1 instead of a second SUMPRODUCT formula. It might run a little faster than that formula if there's a ton of data.
Bookmarks