+ Reply to Thread
Results 1 to 4 of 4

Most efficient sumproduct with criteria?

  1. #1
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Most efficient sumproduct with criteria?

    On a large scale, what is the most efficient way to multiply 2 columns together given a criteria (A1)


    Please Login or Register  to view this content.
    ?

    Please Login or Register  to view this content.
    ?

    Other?
    TechRetard.ToString();

    There are always multiple ways to do something, when it doubt, drink a beer.

    I do not care if you rep or not but please mark post as Solved if there is resolution so I stop going back and checking if anything else is needed.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Most efficient sumproduct with criteria?

    I would guess the first, but most efficient would be to add a column that multiplies B2:B10 by C2:C10, then use SUMIF

    e.g =SUMIF(A2:A10,A1,D2:D10)

    where D2:D10 contains the =B2*C2 formula copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Most efficient sumproduct with criteria?

    =SUMPRODUCT(--(A2:A10=A1), B2:B10,C2:C10)
    or
    =SUMPRODUCT((A2:A10=A1)*(B2:B10)*(C2:C10))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Most efficient sumproduct with criteria?

    If you're interested there is calculation timer code at this link. Then you can run some tests and see for yourself which version is more efficient.

    http://msdn2.microsoft.com/en-us/library/aa730921.aspx
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. [SOLVED] Sumproduct - formula more efficient/faster?
    By Gti182 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-17-2013, 07:45 AM
  2. Replies: 5
    Last Post: 04-20-2012, 08:54 AM
  3. Most efficient way of deleting row based on criteria
    By WasWodge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2011, 09:31 PM
  4. Replies: 13
    Last Post: 01-26-2010, 05:29 PM
  5. IF, SUMPRODUCT, VLookup-most efficient?
    By excellicious in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-20-2008, 09:59 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