Excel – Sum cells based on vertical and horizontal criteria in Excel

microsoft excelworksheet-function

I have a spreadsheet which is similar in structure to what you can see on this spreadsheet.

Spreadsheet

I tried several ways to calculate YTD figures of the different categories but failed. What formula should I put in cell C14 to get all fruits summed up between Week 1 and Week 5?

Best Answer

Apparently I can't add a comment, but Scott Craner's answer only gives the total for week 5, not a YTD. To add the totals for each week up to and including week 5, change the first equal sign to <=:

=SUMPRODUCT(C3:L9,(C2:L2<=C12)*(B3:B9=C13))
Related Question