The INDEX function brings back an array of values based on the range criteria. This is what it actually returns:
The zeros are non matches of 'Apple' in this instance. So put that in to the MAX function and it returns the maximum date relating to 'Apples'. This becomes the match criteria in both the SUMIFS and SUMPRODUCT functions.
With SUMPRODUCT the arguments with '=' return Boolean values True/False, which are coerced to 1's and 0's. As you can see from this table if all arguments are True then you get 1 which then multiplies the other arrays of values to give you a final sum.
Here's a link to a MS help page:
https://support.office.com/en-gb/art...c-4d2145a2fd2e
For the negative values try these. For the Total:
and for the Average:
I've named the ranges for ease of reference. Try these out to see if they return the values you'd expect. I hope all this makes some sense.
DBY
Bookmarks