+ Reply to Thread
Results 1 to 10 of 10

sumifs with multiple conditions

  1. #1
    Registered User
    Join Date
    03-02-2014
    Location
    uae
    MS-Off Ver
    Excel 2010
    Posts
    3

    sumifs with multiple conditions

    In below table i need to sum invoice amount if condition 1) : salesman code is 10657,
    condition 2) : voucher no contain text 'pdcrv' or 'CRV',
    most important condition 3) : if receipt date is within 10 days of invoice date


    Please Login or Register  to view this content.
    I am sure will get solution here.
    Last edited by JBeaucaire; 07-20-2016 at 10:47 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: sumifs with multiple conditions

    To use SUMIFS you would need to add one more column to your data, a column with the formula:

    =E2-A2

    Then this SUMIFS would work:

    =SUMIFS($G$2:$G$5, $D$2:$D$5, 10657, $F$2:$F$5, "<>*CRV*", $H$2:$H$5, "<=10")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-11-2016
    Location
    Liberty Lake, Washington
    MS-Off Ver
    2010
    Posts
    79

    Re: sumifs with multiple conditions

    Quote Originally Posted by JBeaucaire View Post
    To use SUMIFS you would need to add one more column to your data, a column with the formula:

    =E2-A2

    Then this SUMIFS would work:

    =SUMIFS($G$2:$G$5, $D$2:$D$5, 10657, $F$2:$F$5, "<>*CRV*", $H$2:$H$5, "<=10")
    Looks like we forgot to add part of the second condition for excluding voucher numbers with 'pdcrv'. Amended code:
    Please Login or Register  to view this content.
    Personally, I would recommend making your source data into a table (click in data > Insert > Table > My Table Has Headers) and using the following code, which will adapt as your source data expands:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: sumifs with multiple conditions

    With code

    Please Login or Register  to view this content.
    Kind regards
    Leo

  5. #5
    Registered User
    Join Date
    05-11-2016
    Location
    Liberty Lake, Washington
    MS-Off Ver
    2010
    Posts
    79

    Re: sumifs with multiple conditions

    LeoTaxi, you forgot excluding pdcrv as well.

  6. #6
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Red face Re: sumifs with multiple conditions

    I forgot both

    Please Login or Register  to view this content.
    this should be better

  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

    Just an observation...

    Quote Originally Posted by cpg_123 View Post
    condition 2) : voucher no contain text 'pdcrv' or 'CRV'
    I think everyone is misinterpreting that phrase.

    I don't think it means: "voucher does not contain text 'pdcrv' or 'CRV' "

    If you look at the posted sample table, "voucher no" is one of the column headers.

    So, my interpretation is: "if the voucher number range contains the text 'pdcrv' or 'CRV' "

    Also, I think this should be relatively easy with a SUMPRODUCT function.

    Further clarification from the OP including telling us what result they expect would help us help them!
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: sumifs with multiple conditions

    My formula excludes any text string with CRV in it, which was the second exclusions criteria. You don't need to exclude pdcrv because all*crv* is already excluded, so that takes out pdcrv, too.

  9. #9
    Registered User
    Join Date
    05-11-2016
    Location
    Liberty Lake, Washington
    MS-Off Ver
    2010
    Posts
    79

    Re: sumifs with multiple conditions

    Quote Originally Posted by JBeaucaire View Post
    My formula excludes any text string with CRV in it, which was the second exclusions criteria. You don't need to exclude pdcrv because all*crv* is already excluded, so that takes out pdcrv, too.
    Aha, that makes sense. Sorry about my misunderstanding.

    Quote Originally Posted by Tony Valko View Post
    So, my interpretation is: "if the voucher number range contains the text 'pdcrv' or 'CRV' "
    I think you're right, Tony. Good observation.
    Last edited by HWScott; 07-20-2016 at 01:32 PM.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: sumifs with multiple conditions

    Quote Originally Posted by JBeaucaire View Post
    To use SUMIFS you would need to add one more column to your data, a column with the formula:

    =E2-A2

    Then this SUMIFS would work:

    =SUMIFS($G$2:$G$5, $D$2:$D$5, 10657, $F$2:$F$5, "<>*CRV*", $H$2:$H$5, "<=10")
    If the goal is to have only the rows with PDCRV or CRV included in the SUM, then this alteration:

    =SUMIFS($G$2:$G$5, $D$2:$D$5, 10657, $F$2:$F$5, "=*CRV*", $H$2:$H$5, "<=10")

+ 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. SUMIFS with multiple conditions
    By AadVissers in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-21-2016, 12:22 PM
  2. [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
  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