add 1 more outer criteria, use it outside sumifs: if d8 is true, lastQ[[region]:[region]]=c8, if false, ignore this criteria. =LET( 
  jarir,         $D$2,
  extra,         $D$3,
  branded,       $D$4,
  unbranded,     $D$5,
  primaryLOB,    $C$13,
  primaryTier,   $C$14,
  primarySSub,   $C$15,
  primaryConfig, $C$16,
  primaryColor,  $C$17,
  sumCriteria, LAMBDA(hq,prog,
    IF(AND( NOT($D$6), NOT($D$7) ),

      SUMIFS(
        lastQ[W1],
        lastQ[[Measure]:[Measure]], $AB$10,
        lastQ[[LOB]:[LOB]], primaryLOB,
        lastQ[[Tier]:[Tier]], primaryTier,
        lastQ[[HQ]:[HQ]], hq,
        lastQ[[Sub]:[Sub]], primarySSub,
        lastQ[[Configuration]:[Configuration]], primaryConfig,
        lastQ[[Color]:[Color]], primaryColor,
        lastQ[[Programm]:[Programm]], prog
      ),
      IF(AND($D$6, $D$7),
        SUM(
          SUMIFS(
            lastQ[W1],
            lastQ[[Measure]:[Measure]], $AB$10,
            lastQ[[LOB]:[LOB]], primaryLOB,
            lastQ[[Tier]:[Tier]], primaryTier,
            lastQ[[HQ]:[HQ]], hq,
            lastQ[[Sub]:[Sub]], primarySSub,
            lastQ[[Configuration]:[Configuration]], primaryConfig,
            lastQ[[Color]:[Color]], primaryColor,
            lastQ[[Programm]:[Programm]], prog,
            lastQ[[STM+]:[STM+]], $C$6
          ),
          SUMIFS(
            lastQ[W1],
            lastQ[[Measure]:[Measure]], $AB$10,
            lastQ[[LOB]:[LOB]], primaryLOB,
            lastQ[[Tier]:[Tier]], primaryTier,
            lastQ[[HQ]:[HQ]], hq,
            lastQ[[Sub]:[Sub]], primarySSub,
            lastQ[[Configuration]:[Configuration]], primaryConfig,
            lastQ[[Color]:[Color]], primaryColor,
            lastQ[[Programm]:[Programm]], prog,
            lastQ[[STM+]:[STM+]], $C$7
          )
        ),
        IF($D$6,

          SUMIFS(
            lastQ[W1],
            lastQ[[Measure]:[Measure]], $AB$10,
            lastQ[[LOB]:[LOB]], primaryLOB,
            lastQ[[Tier]:[Tier]], primaryTier,
            lastQ[[HQ]:[HQ]], hq,
            lastQ[[Sub]:[Sub]], primarySSub,
            lastQ[[Configuration]:[Configuration]], primaryConfig,
            lastQ[[Color]:[Color]], primaryColor,
            lastQ[[Programm]:[Programm]], prog,
            lastQ[[STM+]:[STM+]], $C$6
          ),
          IF($D$7,

            SUMIFS(
              lastQ[W1],
              lastQ[[Measure]:[Measure]], $AB$10,
              lastQ[[LOB]:[LOB]], primaryLOB,
              lastQ[[Tier]:[Tier]], primaryTier,
              lastQ[[HQ]:[HQ]], hq,
              lastQ[[Sub]:[Sub]], primarySSub,
              lastQ[[Configuration]:[Configuration]], primaryConfig,
              lastQ[[Color]:[Color]], primaryColor,
              lastQ[[Programm]:[Programm]], prog,
              lastQ[[STM+]:[STM+]], $C$7
            ),
            0
          )
        )
      )
    )
  ),
  result,
    IF(AND(jarir, extra),
      SUM(
        IF(AND(branded, unbranded),
          sumCriteria("Jarir", "Branded") + sumCriteria("Jarir", "Unbranded"),
          sumCriteria("Jarir", IF(branded, "Branded", IF(unbranded, "Unbranded", "")))
        ),
        IF(AND(branded, unbranded),
          sumCriteria("extra", "Branded") + sumCriteria("extra", "Unbranded"),
          sumCriteria("extra", IF(branded, "Branded", IF(unbranded, "Unbranded", "")))
        )
      ),
      IF(jarir,
        IF(AND(branded, unbranded),
          sumCriteria("Jarir", "Branded") + sumCriteria("Jarir", "Unbranded"),
          sumCriteria("Jarir", IF(branded, "Branded", IF(unbranded, "Unbranded", "")))
        ),
        IF(extra,
          IF(AND(branded, unbranded),
            sumCriteria("extra", "Branded") + sumCriteria("extra", "Unbranded"),
            sumCriteria("extra", IF(branded, "Branded", IF(unbranded, "Unbranded", "")))
          ),
          ""
        )
      )
    ),
  result
)