Embed IFs to generate the various functions... ie if not required the field should be omitted from the Function altogether meaning you need different functions based on the combination of selections.

As I see it you have 4 possible combinations:

Country Specific & Product Specific (all fields incl in Function)
Country Specific & Non Product Specific (no Product field in Function)
Non Country Specific & Product Specific (no Country field in Function)
Non Country Specific & Non Product Specific (neither Country nor Product field in Function)