+ Reply to Thread
Results 1 to 20 of 20

Translate Sumifs logic to a working Excel formula

Hybrid View

caabdul Translate Sumifs logic to a... 05-31-2018, 11:15 PM
MrShorty Re: Translate Sumifs logic to... 06-01-2018, 12:33 AM
caabdul Re: Translate Sumifs logic to... 06-01-2018, 04:19 AM
Ace_XL Re: Translate Sumifs logic to... 06-01-2018, 05:24 AM
caabdul Re: Translate Sumifs logic to... 06-02-2018, 03:04 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 03:20 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 03:30 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 03:45 AM
caabdul Re: Translate Sumifs logic to... 06-02-2018, 03:53 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 03:55 AM
caabdul Re: Translate Sumifs logic to... 06-02-2018, 04:00 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 04:06 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 04:04 AM
caabdul Re: Translate Sumifs logic to... 06-02-2018, 04:08 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 04:11 AM
caabdul Re: Translate Sumifs logic to... 06-02-2018, 04:13 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 04:15 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 04:21 AM
caabdul Re: Translate Sumifs logic to... 06-02-2018, 04:59 AM
AliGW Re: Translate Sumifs logic to... 06-02-2018, 05:05 AM
  1. #1
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Translate Sumifs logic to a working Excel formula

    Hi

    I have following logic but can't create a sumifs Formula.

    D1 Logic=Sumifs(Sum ColumnS IF 
                                            (
                                             the value in cell A1 matches with value in columnN AND 
                                             the value in columnM is "pleted " AND 
                                            (the value in ColumnP is nothing OR "" OR less than or Equal to 200) AND
                                            the value in columnR is (LessThan or EqualTo 6 OR Greater than 8)
                                             )
    I have made following formula but it is not working;
    =SUMIFS(S:S,N:N,A1,M:M,"pleted ",P:P,"<="&200,R:R,OR("<="&6,">"&8))
    Any clue?
    Last edited by caabdul; 06-02-2018 at 05:00 AM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,391

    Re: Translate Sumifs logic to a working Excel formula

    A single SUMIFS() can only handle and logic -- sum records where all of the conditions are met. Without seeing your data or understanding your desired goal (to evaluate whether a pivot table or some other approach might be preferable), I would add a couple of helper columns [GASP! -- who would dare to suggest helper columns?] to handle the or parts of the logic, then include those helper columns in the SUMIFS(). [Note that I am assuming columns T and U are available for this -- put these helper wherever is convenient for your sheet.]

    1) T1 =OR(P1="",P1<=200) copy down
    2) U1= OR(R1<=6,R1>8)
    3) sumifs cell becomes =SUMIFS(S:S,N:N,A1,M:M,"pleted ",T:T,TRUE,U:U,TRUE)
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Translate Sumifs logic to a working Excel formula

    Here is a Sumifs with OR logic but I can't get it working for me.

    https://exceljet.net/formula/sumifs-...a-and-or-logic

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Translate Sumifs logic to a working Excel formula

    Try

    =SUMIFS(S:S,N:N,A1,M:M,"pleted ",P:P,"<="&200,R:R,{"<=6",">8"})
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Translate Sumifs logic to a working Excel formula

    Please check the file. All other conditions work but one does not work which is as follows:

    =SUMIFS(S:S,P:P,{"<=200","="""})

    So if the value in Col P is "", I get 0 answer. But the correct answer should be 5.

    File attached for your reference.
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    Try this:

    =SUM(SUMIFS(S:S,P:P,{"<=200",""}))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    So, for the whole thing, then:

    =SUM(SUMIFS(S:S,N:N,A1,M:M,"pleted",P:P,{"<=200",""},R:R,{"<=6",">8"}))

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    So, how are we getting on? Did the suggestions work for you?

  9. #9
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Translate Sumifs logic to a working Excel formula

    AliGW

    It works alone but doesn't work within whole formula.

    I tried

    =SUM(SUMIFS(S:S,N:N,A1,M:M,"pleted ",P:P,{"<=200",""},R:R,{"<=6",">8"}))

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    Attach a test file where it isn't working.

    PS "Thank you" would be nice ...

  11. #11
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Translate Sumifs logic to a working Excel formula

    File attached
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    Or you could just follow the instructions in the tutorial correctly!!!

    =SUM(SUMIFS(S:S,N:N,A1,M:M,"pleted ",P:P,{"<=200",""},R:R,{"<=6";">8"}))

    Adding another OR criteria

    You can add one additional criteria to this formula, but you'll need to use a single column array for one criteria and a single row array for the other. So, for example, to sum orders that are "Complete" or "Pending", for either "Andy Garcia" or "Bob Jones", you can use:

    =SUM(SUMIFS(E4:E11,D4:D11,{"complete","pending"},C4:C11,{"Bob Jones";"Andy Garcia"}))
    Last edited by AliGW; 06-02-2018 at 04:19 AM.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    Why not use this?

    =SUM(SUMIFS(S:S,N:N,A1,M:M,"pleted ",P:P,{"<=200",""},R:R,"<>5"))

  14. #14
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Translate Sumifs logic to a working Excel formula

    Column R value should be greater than or Equal to 6 but less than 8.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    Then change the operators:

    =SUM(SUMIFS(S:S,N:N,A1,M:M,"pleted ",P:P,{"<=200",""},R:R,{">=6";"<8"}))

    Why not just say =7, though?

    Or maybe you want this?

    =SUM(SUMIFS(S:S,N:N,A1,M:M,"pleted ",P:P,{"<=200",""},R:R,">=6",R:R,"<8"))
    Last edited by AliGW; 06-02-2018 at 04:13 AM.

  16. #16
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Translate Sumifs logic to a working Excel formula

    Thank AliGW. This works

    But I wonder why there is a comma in P:P,{"<=200",""}
    and a semicolon in R:R,{"<=6";">8"}

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    Because that's what is required to make it work: https://exceljet.net/formula/sumifs-...a-and-or-logic

    You need a single column array for one and a single row array for the other.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

    EDIT: I've done it for you.
    Last edited by AliGW; 06-02-2018 at 04:48 AM.

  19. #19
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Translate Sumifs logic to a working Excel formula

    Yes AliGW you have done a great help.

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Translate Sumifs logic to a working Excel formula

    Glad to hear it - thanks for letting us know.

+ 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 formula not working with Dates
    By Bigred25 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2014, 10:25 AM
  2. SUMIFS formula not working in Excel 2003
    By Sc0tt1e in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-10-2014, 07:34 AM
  3. [SOLVED] Sumifs Formula not working correctly
    By jamaal09 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-01-2013, 09:36 PM
  4. Sumifs formula isn't working correctly
    By gjergji in forum Excel General
    Replies: 5
    Last Post: 09-20-2012, 05:15 PM
  5. [SOLVED] SUMIFS formula not working in VBA
    By meechie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2012, 03:06 PM
  6. Excel 2007 : SUMIFS Formula Not Working
    By milliemoo in forum Excel General
    Replies: 7
    Last Post: 03-06-2012, 12:16 PM
  7. Sumifs formula not working
    By todd.graff@gmail.com in forum Excel General
    Replies: 6
    Last Post: 09-21-2009, 02:26 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