• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sum rows based on criteria on both columns and rows

wysie218

New Member
Hi, I need to sum rows based on criteria on both columns and rows. How do I do that? For example, I want the sum of sales for stores that are of type "SIS" and are comp "Y" for weeks 1-4. See attached example file. Thank you.
 

Attachments

Hi Prasad, thanks, but it does not work. I need to add that I cannot change the structure of the file. To the right I've added examples...any of the criteria can change (no. of weeks, comp, type) and other than manually adding it up I'm not sure how to do it.
 

Attachments

Hi -

One more option...

Try below in the attachment in #4

SUMPRODUCT(($B$5:$J$56)*($B$2:$J$2=$O5)*($B$3:$J$3=$P5)*($B$4:$J$4=Q$4)*($B$1:$J$1=$N5)*($A$5:$A$56>=MID($M5,SEARCH(" ",$M5),SEARCH("-",$M5)-SEARCH(" ",$M5))*1)*($A$5:$A$56<=RIGHT($M5,LEN($M5)-SEARCH("-",$M5))*1))
 
Back
Top