+ Reply to Thread
Results 1 to 24 of 24

sumproduct if question

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    sumproduct if question

    hey guys, first post to this site- i am having a hard time figuring out an issue in excel and was hoping you guys could help out


    Broker security rate
    BA a 1
    BA b 2
    CS a 3
    CS c 2
    DB f 1
    DB g 2
    GS a 3
    GS b 4
    GS c 1
    GS d 2
    GS e 1


    I need something that will do the following- based off another cell lets say X1 and X2,

    find all the securities, that broker X2 has within X1 securities' list and sums the rates (column M) for those securities for broker x2


    I am working with a fomula =SUMPRODUCT(--(data!$A$2:$A$159361=Scorecard!$X$1))*SUMPRODUCT((data!$A$2:$A$159361=Scorecard!X$2)*(data!$M$2:$M$159361)

    The formulas is not working properly so your help is appreciated

  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: sumproduct if question

    Perhaps

    =SUMPRODUCT((data!$A$2:$A$159361=Scorecard!$X$1)*(data!$A$2:$A$159361=Scorecard!X$2)*(data!$M$2:$M$159361))
    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
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    that doesnt work either, you first need to calculate the array that makes up X1, then find the subset of that array that comprises X2, then with this array that is basically an intersection of X1 AND X2 sum the rates

  4. #4
    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: sumproduct if question

    Be sure that best way to describe your problem is to upload a sample workbook.

    Be sure that all sensitive data removed, showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that.

    To attach a small sample workbook.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question


  6. #6
    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: sumproduct if question

    Do you mean?

    =SUMPRODUCT(($A$9:$A$32=$F$3)+($A$9:$A$32=$F$4)*($C$9:$C$32))

    OR ?

    =SUMPRODUCT(($A$9:$A$32=$F$3)*($C$9:$C$32))+SUMPRODUCT(($A$9:$A$32=$F$4)*($C$9:$C$32))

  7. #7
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    netiher of those worked, essentially it should sum column c11,c22, and c29 because those 3 securities are in both GS and ML

    In a small dataset this can be done manually, but the actual trade file is like 20,000 rows so i need a formula for this

    thanks again for your help

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: sumproduct if question

    Try this for ML

    =SUMPRODUCT(--($A$9:$A$32="ML")*($C$9:$C$32))
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  9. #9
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    That doesnt work because you never incorporate to check if GS is holdiing it. That formula just gives me the sum of all the rates for ML

    I need the rates for ML only in the stocks held by GS

  10. #10
    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: sumproduct if question

    ...................

  11. #11
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    GS- ALL Letters hahaha

  12. #12
    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: sumproduct if question

    It's late for me....

    I don't understand the logic..In my example, why all the rows that have true value in column E are not added but only the green cells??
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    you are right only the highlighted green cells should be added together

    the logic is as such- lets say there are 2 used car dealers
    one has 5 car models, the second has 3 car models
    only 2 of the models are the same for both dealers 1 and dealer 2
    i am ultimately trying to find the total value of the cars with dealer 2 that are also held with dealer 1

  14. #14
    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: sumproduct if question

    But in my example both brokers have 3 cars each one of them with the same code(column B)..

    B3B8V9 244412 & B0XHV5

    Why-which is the logic-to add only the green cells and not all of these OR only the others?

  15. #15
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    adding only the green cells would yield the correct resut

  16. #16
    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: sumproduct if question

    Must be a condition for doing that..Which is that condition?

  17. #17
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    the reason whe you sum green is because ML is broker 2 and those 3 securities match the holdings of broker 1

  18. #18
    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: sumproduct if question

    =sumproduct((a9:a32=f4)*(e9:e32=true)*(c9:c32))

  19. #19
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: sumproduct if question

    Please take a look at the attached file. It may not be exactly as you want it as it uses some helper rows to get to the correct answer.
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    you guys are both awesome

    thanks a ton for your help

  21. #21
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: sumproduct if question

    You're Welcome and if your issues is resolved please mark thread as "Solved"

  22. #22
    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: sumproduct if question

    Quote Originally Posted by miller_ilya View Post
    you guys are both awesome

    thanks a ton for your help


    You are welcome and thanks for the feed back.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thank you.

  23. #23
    Registered User
    Join Date
    09-04-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: sumproduct if question

    so guys apparently i oversimplified my initial explanation

    in the attached sheet, its is actually a list of brokers that i need to do this calculation for

    any help is appreciatedexcelforum_upload.xlsx

  24. #24
    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: sumproduct if question

    I hope this time your explanations to don't be simplified!!

    1 ugly way could be this.

    I used these formulas.

    Please Login or Register  to view this content.
    ARRAY formula to get the results for eatch Broker.
    Please Login or Register  to view this content.
    To find which stock from eatch Broker are common with broker 1.

    =SUM(K5:K12)

    For the final result.

    Comments?
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sumproduct question
    By Selo in forum Excel General
    Replies: 6
    Last Post: 12-09-2006, 07:33 AM
  2. SUMPRODUCT Question
    By s2m via OfficeKB.com in forum Excel General
    Replies: 2
    Last Post: 08-09-2006, 09:39 AM
  3. [SOLVED] sumproduct question
    By Dominique Feteau in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  4. RE: Question about sumproduct
    By bj in forum Excel General
    Replies: 0
    Last Post: 04-21-2005, 01:06 PM
  5. [SOLVED] Question about sumproduct
    By Jason in forum Excel General
    Replies: 1
    Last Post: 04-21-2005, 01:06 PM

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