The trick is to check that thesum_rangeandcriteria_rangeare the same dimensions.
SUMIFS with horizontal range
To use SUMIFS with a horizontal range, be sure both the sum_range and criteria_range are the same dimensions. In the example shown, the formula in cell I5 is: =SUMIFS(B5:G5,$B$4:$G$4,"red") which returns the total of items in "Red" columns for each row.