To avoid
volatile functions you can also use a little known (or rarely used) property of the INDEX function in D2
Code:
=COUNTBLANK(INDEX(Table2[#All],MATCH(Table1[[#This Row],[Name]],Table2[Name],0)+1,))
The extra comma force the INDEX function to return the entire corresponding row