+ Reply to Thread
Results 1 to 8 of 8

Sumif or Sumproduct with Multiple Rows & Columns

  1. #1
    Registered User
    Join Date
    04-07-2008
    Posts
    7

    Sumif or Sumproduct with Multiple Rows & Columns

    This question is a bit different from any other that I could find. For important reasons I have a spreadsheet that has a setup similar to the example below. I would like, for example, to use a formula that would sum the total "Criteria 2" for those columns labeled with "A". I would expect the total to be equal to 40.00, but I cannot figure out a way to have a formula sum all criteria 2s that match a description found in multiple columns (there is a sub-header below the column headings that I need to leave intact - otherwise I would just sum the data into one column). Thanks in advance!

    The column headers are A, B, C, A, D, E, F and are over the 10.00's - cannot figure out how to make it show up correctly in this post. I've also attached a sample workbook.

    A B C A D E F
    Criteria 1 10.00 10.00 10.00 10.00 10.00 10.00 10.00
    Criteria 2 10.00 10.00 10.00 10.00 10.00 10.00 10.00
    Criteria 3 10.00 10.00 10.00 10.00 10.00 10.00 10.00
    Criteria 1 10.00 10.00 10.00 10.00 10.00 10.00 10.00
    Criteria 5 10.00 10.00 10.00 10.00 10.00 10.00 10.00
    Criteria 2 10.00 10.00 10.00 10.00 10.00 10.00 10.00
    Criteria 7 10.00 10.00 10.00 10.00 10.00 10.00 10.00
    Attached Files Attached Files

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

    =SUMPRODUCT(($C$2:$C$8="Criteria 2"))*($D$1:$J$1="A"),$D$2:$J$8)

    note the criteria can refer to cells containing the text.
    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
    Registered User
    Join Date
    04-07-2008
    Posts
    7
    Quote Originally Posted by NBVC
    Try:

    =SUMPRODUCT(($C$2:$C$8="Criteria 2"))*($D$1:$J$1="A"),$D$2:$J$8)

    note the criteria can refer to cells containing the text.
    Awesome... one too many ) in the middle there, but does exactly what I was asking. Thanks so much.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by vulches
    Awesome... one too many ) in the middle there, but does exactly what I was asking. Thanks so much.

    Good catch. Just testing

  5. #5
    Registered User
    Join Date
    09-21-2011
    Location
    Austin, TX
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sumif or Sumproduct with Multiple Rows & Columns

    NBVC you are the man, your formula just saved me a ton of work

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Sumif or Sumproduct with Multiple Rows & Columns

    Austin, NBVC is still on the site, but I doubt he still reads three year old threads.
    Maybe send him a PM?

  7. #7
    Registered User
    Join Date
    08-29-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    13

    Unhappy Sumif or Sumproduct with Multiple Rows & Columns

    Greetings Forum,

    I have a similar dilemma as to the above gentleman. I am trying to add only column PA. I was trying to insert a sumproduct but i kept getting an error. I have attached a picture to show an example. I would like to be able to drag the formula down for all products.
    Any help is greatly appreciated. Thank you


    PA PA TX TN J1 76 KS Req PA TX TN J1 76 KS Req PA TX TN J1 76 KS Req PA TX TN J1 76 KS Req PA TX TN J1 76 KS Req
    Product A 1 2 3 4 5
    Product B
    Product C
    Product D




    Excel Example.PNG

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Sumif or Sumproduct with Multiple Rows & Columns

    lqorri welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    Aslo, Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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