If row 8, if the "UTO" values would only ever appear in those four columns you mentioned, you could get away with a simpler SUMIFS formula like this:
Code:
=SUMIFS(D7:T7,B8:R8,"UTO")
But if the following situation could exist:
- a value of "UTO" in cell C8 (not one of your mentioned columns)
- a numeric value in cell E7 (not one of your mentioned columns)
That value would be picked up by the SUMIFS formula (when you do not want it to).
SUMPRODUCT can be use in place of any COUNTIF, COUNTIFS, SUMIF, or SUMIFS formula, but has more flexibility than those.
(for a write-up on SUMPRODUCT and how that all works, see:
https://www.ablebits.com/office-add...duct-function-formula-examples/#Conditionally)
The SUMIFS formula above I listed would look like this as a SUMPRODUCT formula:
Code:
=SUMPRODUCT(--(B8:R8="UTO"),--(D7:T7))
So, all that I did was add another condition to that SUMPRODUCT.
While kind of daunting looking at first, it isn't so bad when you see what is going on.
The columns you wanted to check, D, H, L, P and T, are the 4th, 8th, 12th, 16th, and 20th columns respectively.
What do they all have in common? They are all multiple of 4!
The Excel COLUMN function return the column number for any cell. For example:
=COLUMN(D7)
would return 4
So we can use that function to get the column number of the cells we are working across.
The MOD function gives us a remainder when the first number is divided by the second.
So in the formula, we are dividing the column number by 4 to see what our remainder is.
Since all the columns we want to consider are multiples of 4, their remainders when divided by 4 is 0.
So this condition ensures that we are only include columns that are multiples of four.
I hope that helps clarify things a little.