+ Reply to Thread
Results 1 to 9 of 9

SUMIFS with multiple conditions

  1. #1
    Registered User
    Join Date
    04-30-2015
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    12

    SUMIFS with multiple conditions

    Hi there,

    I'm trying to count some values, according to multiple conditions.

    This is a discription of my data:

    A:A Date
    B:B Discription
    C:C Code
    D:D Team
    E:E Each cell is this column has the value of 1, so these can be summed to count

    For each day I want to count the, accordion to:
    Team = "Team A"
    AND
    Discription = "correction" of "vallidation" OR Code = 122, 135 or 165

    I figured that a formula without the code condition could be
    =sum( sumifs( E:E , D:D,"Team A", B:B, {"correction","vallidation"}))

    Then I tried to add te code condition:
    =sum( sumifs( E:E , D:D,"Team A", B:B, {"correction","vallidation"} , C:C,{122,135,165}))

    This does not return the right values, because there is an AND relation between discription and code, instaid of an OR relation.

    Can anybody help me with a formula that solves this problem? That would help a lot!

    Thank you!

  2. #2
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: SUMIFS with multiple conditions

    Hello AadVissers,

    You can always fall back to the big guy SUMPRODUCT:

    =SUMPRODUCT(E:E,--(D:D="Team A"),--(((B:B="correction")+(B:B="vallidation")+(C:C=122)+(C:C=135)+(C:C=165))>0))
    (copy pasta from Ford)
    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

    Regards,
    Lem

  3. #3
    Registered User
    Join Date
    04-30-2015
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    12

    Re: SUMIFS with multiple conditions

    Thanks for the reply. Unfortunally this returns an error: #NAME?

  4. #4
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: SUMIFS with multiple conditions

    Really? It works totally fine on my end, are you sure the formula is SUMPRODUCT? #NAME? is an error for trying to use an undefined formula / range

  5. #5
    Registered User
    Join Date
    04-30-2015
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    12

    Re: SUMIFS with multiple conditions

    Jeez, my bad... I'm using a Dutch version of Excel, and made a typo in the translation....

    Thanks! Works perfectly

  6. #6
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: SUMIFS with multiple conditions

    Aaaah, it happens. Thank you for the feed back.

    If you have found a fitting solution to your problem, please mark the Thread as [SOLVED] using the Thread tools right above post #1. It keeps things neat and tidy.

    And have a great day!

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

    Re: SUMIFS with multiple conditions

    Quote Originally Posted by AadVissers View Post

    Then I tried to add te code condition:
    =sum( sumifs( E:E , D:D,"Team A", B:B, {"correction","vallidation"} , C:C,{122,135,165}))
    When you have 2 array constants they need to be in opposite directions of each other. Both of those arrays are horizontal.

    Try it like this:

    =SUM(SUMIFS(E:E,D:D,"Team A",B:B,{"correction";"vallidation"},C:C,{122,135,165}))

    In that version one array is vertical and the other is horizontal.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Registered User
    Join Date
    04-30-2015
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    12

    Re: SUMIFS with multiple conditions

    So, =SUMPRODUCT(E:E,--(D:D="Team A"),--(((B:B="correction")+(B:B="vallidation")+(C:C=122)+(C:C=135)+(C:C=165))>0)) does the job, but I have an additional probrem;

    The discription condition (B:B) should be; "contains" correction or vallidation, for example 'the correction of....'

    I tried =SUMPRODUCT(E:E,--(D:D="Team A"),--(((B:B="*correction*")+(B:B="*vallidation*")+(C:C=122)+(C:C=135)+(C:C=165))>0)), but that doen't work...

    Any ideas?

  9. #9
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: SUMIFS with multiple conditions

    Maybe something like this?

    =SUMPRODUCT(E:E,--(D:D="Team A"),--(((1-ISERROR(SEARCH("correction",B:B)))+(1-ISERROR(SEARCH("variation",B:B)))+(C:C=122)+(C:C=135)+(C:C=165))>0))

    I hate counting blankets ;w;
    Last edited by Lemice; 06-21-2016 at 12:25 PM.

+ 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] SUMIFS returning NIL on multiple conditions in one column
    By mysticmoron109 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-03-2015, 09:12 PM
  2. SUMIFs With Multiple Not Equal To Conditions In a Single Column
    By 5150 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-14-2015, 12:08 PM
  3. Sumifs multiple conditions
    By ksmith21 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-16-2015, 06:12 AM
  4. [SOLVED] SUMIFS with multiple conditions Formula
    By rz6657 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-09-2015, 03:13 PM
  5. [SOLVED] Sumifs or Sumproduct With Multiple Conditions Help Please!
    By geepee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-01-2013, 09:27 AM
  6. Multiple conditions - SumProduct, SumIfs, CountIfs - Which do I need?
    By Carcophan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2013, 01:43 PM
  7. sumifs multiple conditions stuck
    By kieranbop in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-31-2011, 07:13 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