You can have a throw away row, either at the top, or at the bottom of your table that houses your COUNTIFS expression
So, if you have them above your table, you can have the "# HQ Purchases" reference the value output from G5 and "# Franchise purchase" can be achieved by using the SUM...