+ Reply to Thread
Results 1 to 6 of 6

Sum from multiple columns based on multiple criteria

  1. #1
    Registered User
    Join Date
    07-29-2017
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Sum from multiple columns based on multiple criteria

    I'm trying to sum multiple columns together based on criteria. The first criteria is the names have to match and the second criteria times have to match. I cant use a helper column because this data will change regularly both the numbers and the names will change.
    I've tried index and match and sumproduct and I can't get either of them to work with this, Although I'm not really familiar with sumproduct so I may just not know how to do it but the last formula I tried was =SUM(IF(AND($E$29=E27,$A$30=$A$2:$A$25),B2:T26)) and it does not work at all. any help you could give would be great!

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Sum from multiple columns based on multiple criteria

    You have a single space after the names Andrew, Alex and Zach in cells C27:E29, so you need to remove those.

    Then you can use this formula in cell B30:

    =SUMPRODUCT((B$29=$B$27:$T$27)*($A30=$A$2:$A$25),$B$2:$T$25)

    and you can copy this across and down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,729

    Re: Sum from multiple columns based on multiple criteria

    mk232003 there are trailing spaces in some of the names. Once removed there are duplicate matt, andrew and alex.

    What outcomes are you expecting?

    The instructions and layout of the data and output area suggest a either a direct duplication of the source data or summaries of the duplicate names under each name?

    Try this to see what I mean:
    1. Remove trailing spaces from the names.
    2. Then try this formula in B30 filled down and across.
      Formula: copy to clipboard
      Please Login or Register  to view this content.
    Dave

  4. #4
    Registered User
    Join Date
    07-29-2017
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Sum from multiple columns based on multiple criteria

    Thanks for the reply Pete_UK and FlameRetired and sorry for my late response! both of your formulas work great for what I asked for! I'm wanting to summarize the numbers under one name if there are multiple names listed. I will attach an updated file for the way I would like the data to ultimately look like..
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,834

    Re: Sum from multiple columns based on multiple criteria

    Try


    in B30

    =SUMPRODUCT(($B$2:$T$25)*($A$2:$A$25=$A30)*($B$27:$T$27=B$29))

    Copy across and down

  6. #6
    Registered User
    Join Date
    07-29-2017
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Sum from multiple columns based on multiple criteria

    JohnTopley, Your formula worked great thanks for the help!

+ 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. Replies: 1
    Last Post: 02-09-2017, 05:55 PM
  2. Average numbers from multiple columns based on multiple criteria
    By abambi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-23-2015, 01:52 PM
  3. Populating fields in multiple cells based on criteria in multiple columns
    By excelalways in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2014, 08:17 AM
  4. formulas for search based on multiple criteria in multiple columns
    By oneworld in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-02-2013, 06:57 AM
  5. [SOLVED] Deleting Duplicates Based on Multiple Criteria from Multiple Columns
    By Franklic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2012, 05:31 PM
  6. Sum data based on multiple criteria across multiple columns
    By lbn7153 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-25-2012, 07:18 AM
  7. Macro to Segregate the data based on Multiple Criteria's in Multiple Columns -Challenging!
    By Novice_To_Excel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-08-2012, 07:31 AM

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