+ Reply to Thread
Results 1 to 8 of 8

Multiple IF AND Condition

  1. #1
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    Multiple IF AND Condition

    Dears
    Hope this email finds you Well.

    The attached sheet is just a sample data, I need write a formula in Column [G] to combine multiple IF AND condition with different result.

    The If condition with AND condition will be combined together to scan the whole column [B] who has the same contract number.

    The below formula is what I am trying to write to get the final result :-

    If the colum [C "contract status" ="ACTV"] and colum [E "Sub Status" has NO value like "NSUB" ], then G2 "No Nsub"], If the colum [C "contract status" ="ACTV"] and colum [E "Sub Status" has value like "NSUB" ] and column [F "Amount due $" for the Sum of All NSUB value <30$>0$] ,then G2"<30$>0$"], If the colum [C "contract status" ="ACTV"] and colum [E "Sub Status" has value like "NSUB" ] and column [F "Amount due $" for the Sum of All NSUB value >=30$] ,then G2 ">=30$"], If the colum [C "contract status" ="ACTV"] and colum [E "Sub Status" has value like "NSUB" ] and column [F "Amount due $" for the Sum of All NSUB value <30$] ,then G2 "<=0$", "<=0$"].


    BR
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Multiple IF AND Condition

    are you sure of your expected results? Your first part of the condition If the colum [C "contract status" ="ACTV"] and colum [E "Sub Status" has NO value like "NSUB" ], then G2 "No Nsub"], seems to exclude the results you have in cells like those in cells H12 through H17 because the sub status is not NSUB in E12 through E17.

    This is what I came up with that seems to work based on what I read in your formulas in column G...
    =IF(AND(C3="actv",E3<>"nsub "),"No Nsub",IF(AND(C3="actv",E3="nsub ",F3>0,F3<30),"<30$>0$",IF(AND(C3="actv",E3="nsub ",F3>=30),">=30$","<=0$")))

    EDIT: oh and by the way, you have an extra space in your sub status NSUB so I added it to the formula instead of incorporating a trim formula into the if statement. This doesn't appear to exist with the other sub statuses though they aren't in the formula anyway and all the values in column C appear to be clean (without extra spaces).
    Last edited by Sam Capricci; 02-22-2018 at 09:38 AM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    Re: Multiple IF AND Condition

    Dear Sambo kid
    Appreciated your feedback and sorry to reply too late.

    Can we amend the formula to incorporate the following changes :-

    At Column [G3]
    1)- Group column [B "Contract Number"] by contract number, the attached list having 4 different groups.
    2)- IF X group contract is having [Contract Status like "ACTVE"], If True move to step 3 else write in each row for the same contract group "<>ACTVE".
    3)- IF X group contract is having [Sub Status like "NSUB"] if True, move to Step 4, else write in each row for the same contract group "<>NSUB".
    4)- IF X group contract [Total amount due for all NSUB ">=30$", if True, write in each row for the same contract group ">=30$",if not move to step 5.
    5)- IF X group contract [Total amount due for all NSUB "<30$>0$", If True, write in each row for the same contract group "<30$>0$",if not move to step 6
    6)- IF X group contract [Total amount due for all NSUB "<=0$", If True write in each row for the same contract group "<=0$".


    Sorry of any inconvenience.

    BR

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Multiple IF AND Condition

    this is hard to interpret but I'm using post #3 and your attachment and guessing but I came up with this...
    =IF(C3<>"ACTV","<>ACTVE",IF(AND(C3="actv",E3<>"nsub "),"<> Nsub",IF(AND(C3="actv",E3="nsub ",F3>=30),">=30$",IF(AND(C3="actv",E3="nsub ",F3<30,F3>0),"<30$>0$",IF(AND(C3="actv",E3="nsub ",F3<=0),"<=0$","")))))
    if this is not what you want I would suggest you attach another sheet with some additional explanations and your expected results.
    I am still basing the formula in part on your first attachment and your notes in post #3. It still does not match your sheet's results column H.

  5. #5
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    Re: Multiple IF AND Condition

    Dear Sambo;
    Thanks for your feedback.

    I am grateful for your continuous support .

    Please check the attached file [Sheet2] for easy reference.

    BR

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Multiple IF AND Condition

    I may have it, at least it matches your sheet...
    =IF(SUMPRODUCT((B:B=B3)*(E:E="nsub"))=0,"No_NSUB",IF(SUMPRODUCT((B:B=B3)*(C:C="ACTV"))=0,"<>ACTV",IF(AND(SUMIFS(F:F,B:B,B3,E:E,"nsub")>0,SUMIFS(F:F,B:B,B3,E:E,"nsub")<30),"<30$>0$",IF(SUMIFS(F:F,B:B,B3,E:E,"nsub")>=30,">=30$",IF(SUMIFS(F:F,B:B,B3,E:E,"nsub")<0,"<0$","")))))

  7. #7
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    106

    Re: Multiple IF AND Condition

    Dear Sambo;
    Marvelous and incredible solution.

    BR

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Multiple IF AND Condition

    Glad I got it for you. And Thank you for the rep!

+ 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] If Condition with Multiple Search & Multiple Results
    By GemBox in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-22-2017, 02:14 AM
  2. [SOLVED] Multiple Condition Countifs with Uniqueness as Condition
    By semantics in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-21-2017, 05:21 PM
  3. sum ifs multiple condition on multiple sheets question
    By Mastiman in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-20-2016, 11:06 PM
  4. Condition formatting of multiple condition formatted cells
    By merrin84 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-22-2015, 05:08 PM
  5. Replies: 1
    Last Post: 12-25-2012, 05:32 PM
  6. Replies: 6
    Last Post: 05-06-2010, 10:06 PM
  7. Multiple condition, multiple range formating
    By sa02000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-11-2009, 09:10 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