+ Reply to Thread
Results 1 to 12 of 12

SUM multiple cells based on multiple cell criteria,not a range

Hybrid View

  1. #1
    Registered User
    Join Date
    05-01-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    6

    SUM multiple cells based on multiple cell criteria,not a range

    Not sure if this is possible but ideally I want to be able to add up 2 or more cells in the same column based on the criteria in other cells of that column. I can't use a general SUMIF as the range would also include numbers no to add up.

    I think the formula should read :
    SUMIF(B14,B31="MARSIL",B17+B37,0)

    but that obviously isn't working. Is there anyway to do this?

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: SUM multiple cells based on multiple cell criteria,not a range

    "based on the criteria in other cells of that column"

    Example data please.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    05-01-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    6

    Re: SUM multiple cells based on multiple cell criteria,not a range

    For instance I would like it to add up cells B7 and B37 if the word MARSIL is located in either of cells B14 or B31

  4. #4
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: SUM multiple cells based on multiple cell criteria,not a range

    Is there any logic to your data? We need to see exactly how it's setup to give detailed solutions. For your above scenario, this would work:

    IF(OR(B14="MARSIL",B31="MARSIL"),B7+B37,"")
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  5. #5
    Registered User
    Join Date
    05-01-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    6

    Re: SUM multiple cells based on multiple cell criteria,not a range

    Thank you that almost works. I am sorry if i am not being clear enough. This is not a form which has been set up purely for data.I have tried to copy in the data below but the formatting won't come in(each line is a cell).
    B14 MARSIL
    B15 DANA : CDC 2893
    B16 1
    B17 4
    Data like this continues through the sheet. I need a running total of the B17 cell for each data block based on the name in B14 but if it doesn't equal this criteria then the figure in B17 shouldn't be included in this total.

    I hope that makes sense

    Thank you

  6. #6
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: SUM multiple cells based on multiple cell criteria,not a range

    Can you upload a sample workbook instead? You can do this by clicking on Go Advanced below, then Manage Attachments.

  7. #7
    Registered User
    Join Date
    05-01-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    6

    Re: SUM multiple cells based on multiple cell criteria,not a range

    Example.xlsxhope that's worked

  8. #8
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: SUM multiple cells based on multiple cell criteria,not a range

    You can use something like this in B11 and drag down to B12; you'll most likely need to alter the ranges to match your actual workbook:

    =SUM(OFFSET($A$1,MATCH(A11,$B$1:$B$8,0)+2,1))

  9. #9
    Registered User
    Join Date
    05-01-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    6

    Re: SUM multiple cells based on multiple cell criteria,not a range

    Thank you, would that work if I multiple entries meeting the factory critieria, for instance to China Silk's?

  10. #10
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: SUM multiple cells based on multiple cell criteria,not a range

    Quote Originally Posted by georgiepod View Post
    Thank you, would that work if I multiple entries meeting the factory critieria, for instance to China Silk's?
    This formula will only match the first occurrence. With the addition of a helper column, a relatively simple formula can be created to create your desired result. Otherwise, there's always VBA.

  11. #11
    Registered User
    Join Date
    05-01-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    6

    Re: SUM multiple cells based on multiple cell criteria,not a range

    ok, thank you for your help

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,658

    Re: SUM multiple cells based on multiple cell criteria,not a range

    Try in B9:

    =SUM(IFERROR((((B1:B5="CHINA SILK")+(B1:B5="MARSIL"))*B4:B8),0))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Quang PT

+ 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. 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
  2. Replies: 6
    Last Post: 11-11-2012, 12:40 AM
  3. [SOLVED] Pull data from multiple cells into one cell based on criteria?
    By chaddug in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-23-2012, 09:54 AM
  4. Replies: 2
    Last Post: 12-03-2011, 03:51 AM
  5. Replies: 9
    Last Post: 12-13-2010, 01:42 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