+ Reply to Thread
Results 1 to 9 of 9

sum product if criteria is ..... calc

  1. #1
    Forum Contributor
    Join Date
    08-06-2009
    Location
    Belfast
    MS-Off Ver
    Excel 2003
    Posts
    107

    sum product if criteria is ..... calc

    =SUMPRODUCT(('2012 - Data'!B$2:B$999="V01")*('2012 - Data'!CP$2:CP$999="Strongly Agree"))

    I have the above calculation which is working but I want to change this to ask if the first range to say if it is anyone of these three critera and a strongly agree then count it.

    See calculation below which I have nused but is not working.

    =SUMPRODUCT(('2012 - Data'!B$2:B$999="V01","Manager","Support Staff")*('2012 - Data'!CP$2:CP$999="Strongly Agree"))

    Im not too sure where I have gone wrong?

    Can someone help?.

    Thanks

    Lorna
    Last edited by Lorna B; 05-24-2012 at 09:44 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: sum product if criteria is ..... calc

    Hi

    =SUMPRODUCT(('2012 - Data'!B$2:B$999="V01","Manager","Support Staff")*('2012 - Data'!CP$2:CP$999="Strongly Agree"))

    The problem is there(red color) but i am not able to understand your new rule..

    Which is this?


    Even better if you can upload a small sample workbook for us...
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: sum product if criteria is ..... calc

    Try this

    =SUMPRODUCT((OR('2012 - Data'!B$2:B$999={"V01","Manager","Support Staff"}))*('2012 - Data'!CP$2:CP$999="Strongly Agree"))


    EDIT: I don't think this works
    Last edited by Cutter; 05-24-2012 at 09:31 AM.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: sum product if criteria is ..... calc

    Or
    =SUM(SUMPRODUCT(('2012 - Data'!B$2:B$999="V01")*('2012 - Data'!CP$2:CP$999="Strongly Agree")),SUMPRODUCT(('2012 - Data'!B$2:B$999="Manager")*('2012 - Data'!CP$2:CP$999="Strongly Agree")),SUMPRODUCT(('2012 - Data'!B$2:B$999="Support Staff")*('2012 - Data'!CP$2:CP$999="Strongly Agree")))

  5. #5
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: sum product if criteria is ..... calc

    Quote Originally Posted by Cutter View Post
    Try this

    =SUMPRODUCT((OR('2012 - Data'!B$2:B$999={"V01","Manager","Support Staff"}))*('2012 - Data'!CP$2:CP$999="Strongly Agree"))


    EDIT: I don't think this works
    You dont need OR

    =SUMPRODUCT(('2012 - Data'!B$2:B$999={"V01","Manager","Support Staff"})*('2012 - Data'!CP$2:CP$999="Strongly Agree"))

  6. #6
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: sum product if criteria is ..... calc

    Quote Originally Posted by Cutter View Post
    Or
    =SUM(SUMPRODUCT(('2012 - Data'!B$2:B$999="V01")*('2012 - Data'!CP$2:CP$999="Strongly Agree")),SUMPRODUCT(('2012 - Data'!B$2:B$999="Manager")*('2012 - Data'!CP$2:CP$999="Strongly Agree")),SUMPRODUCT(('2012 - Data'!B$2:B$999="Support Staff")*('2012 - Data'!CP$2:CP$999="Strongly Agree")))
    This is much better

    =SUMPRODUCT((('2012 - Data'!B$2:B$999="V01")+('2012 - Data'!B$2:B$999="Manager")+('2012 - Data'!B$2:B$999="Support Staff"))*('2012 - Data'!CP$2:CP$999="Strongly Agree"))

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: sum product if criteria is ..... calc

    You dont need OR
    But I got the curly's. Damn, so close.

    This is much better
    So much better.

    So which version would be most efficient for OP to use?
    Or '6 of 1, half dozen of the other'?

  8. #8
    Forum Contributor
    Join Date
    08-06-2009
    Location
    Belfast
    MS-Off Ver
    Excel 2003
    Posts
    107

    Re: sum product if criteria is ..... calc

    Perfect - the final one works for me and i understand what I did wrong too. !!

    Thanks

    Lorna B

  9. #9
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: sum product if criteria is ..... calc

    Quote Originally Posted by Cutter View Post
    So which version would be most efficient for OP to use?
    Or '6 of 1, half dozen of the other'?
    I am not sure there would be significant difference, they are all SUMPRODUCT in the end. Personally, I would go for the one that I (the OP) felt was most explanatory in its construct.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1