Multiple criteria sumif array formula with logic