Hello all. I need a formula that sums an array of values based on certain criteria.
The attached image is a simplified dataset for reference (the actual dataset is significantly larger).
Logic (for fruit): IF B4:B8 (item category) = oranges, OR apples, OR bananas, AND IF C15 (the year) matches C3:G3, return the SUMPRODUCT of the entire array C4:G8.
The logic is similar for veggies.
I tried to use IF AND OR SUMPRODUCT with no success.
Here is the formula I tried to use for fruit: =IF(AND(OR(B4:B8="Oranges","Apples","Bananas"),C15=$C$3:$G$3),SUMPRODUCT($C$4:$G$8))
The attached image is a simplified dataset for reference (the actual dataset is significantly larger).
Logic (for fruit): IF B4:B8 (item category) = oranges, OR apples, OR bananas, AND IF C15 (the year) matches C3:G3, return the SUMPRODUCT of the entire array C4:G8.
The logic is similar for veggies.
I tried to use IF AND OR SUMPRODUCT with no success.
Here is the formula I tried to use for fruit: =IF(AND(OR(B4:B8="Oranges","Apples","Bananas"),C15=$C$3:$G$3),SUMPRODUCT($C$4:$G$8))