+ Reply to Thread
Results 1 to 10 of 10

Sumproduct certain rows

  1. #1
    Registered User
    Join Date
    10-23-2013
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    6

    Sumproduct certain rows

    Hello,

    I have the following table:
    A B C
    Name Value1 Value 2
    1 x 2 1
    2 y 4 4
    3 w 3 6
    4 x 2 7
    5 w 2 3
    6 x 8 4
    7 w 2 9

    I need a formula to calculate sumproduct for each value in col A.
    For ex: sumproduct for x should be 2*1+2*7+8*4=48
    As the table is too big, i do not want to add a new column with the product of values in col B and C and then sumif. I'm hoping to find a formula to do that in a simpler way
    so I could then have in a diff sheet only the sumproducts for x, y, w

    Thank you

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct certain rows

    Try

    =SUMPRODUCT((A1:A7="x")*B1:B7*C1:C7)

  3. #3
    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 certain rows

    Quote Originally Posted by Iulian Panosche View Post
    Hello,

    As the table is too big, i do not want to add a new column with the product of values in col B and C and then sumif.
    Thank you
    If the table is too big it's better to use a helper column and then SUMIF. The calculations will be more fast.
    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.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct certain rows

    Quote Originally Posted by Fotis1991 View Post
    If the table is too big it's better to use a helper column and then SUMIF.
    +1

    Helper columns are NOT a bad thing.
    Excel gives you 256 columns in XL2003, 16384 in XL2007+
    Might as well use some of them.

  5. #5
    Registered User
    Join Date
    10-23-2013
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Sumproduct certain rows

    Example.xlsx

    How come in the attached file it does not work?

  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 certain rows

    It's the worst idea to use whole columns reference for functions as SUPRODUCT(Even if this gives you right results!!)

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct certain rows

    Because the ranges in C and D contain TEXT values (The headers in row 3)

    Don't use entire column references, specify the exact row#s to be used.
    =SUMPRODUCT((Data!B$4:B$10=B4)*Data!C$4:C$10*Data!D$4:D$10)

  8. #8
    Registered User
    Join Date
    10-23-2013
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Sumproduct certain rows

    Thank you all. Now it's ok.
    You've been of great help

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct certain rows

    You're welcome.

  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 certain rows

    You are welcome and thanks for the feedback.

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

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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 for visible rows only
    By torppo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2014, 08:56 AM
  2. Sumproduct for the filtered rows only
    By Gabor in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-14-2010, 05:48 AM
  3. Sumproduct, Rows and Columns
    By windme in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2009, 04:00 PM
  4. SUMPRODUCT with varying # of rows
    By Ren in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-27-2006, 06:35 PM
  5. sumproduct and even numbered rows
    By Jack Sons in forum Excel General
    Replies: 6
    Last Post: 03-30-2005, 07: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