John,
You need to use sumproduct that is this formula.
=sumproduct((alltails=C6)*(ALLWEEKS="Week 40")*ALLJ)
Saurabh