• 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

  • Chandoo Forum Question.xls
    44.5 KB · Views: 0
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

  • Chandoo Forum Question.xls
    29 KB · Views: 0
Hi:

Please find the attached. I have used the helper columns to get the desired results.

Thanks
 

Attachments

  • Chandoo Forum Question.xls
    46 KB · Views: 0
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