+ Reply to Thread
Results 1 to 7 of 7

Help for IF conditions with multiple Conditions (scenario more than 5 conditions)

  1. #1
    Registered User
    Join Date
    12-13-2019
    Location
    Singapore
    MS-Off Ver
    Office365
    Posts
    15

    Help for IF conditions with multiple Conditions (scenario more than 5 conditions)

    Hi

    Can you please help me for the following IF conditions, I tried to create it but it's a bit complex for me. Thank you so much


    Multiple IF conditions to fill-up column CATEGORY


    conditions are under column PACKED LOCATION, SHIPPED TO, CUSTOMER NAME AND RECEIVED LOCATION


    If Packed location=NA Warehouse AND Shipped to = USA AND Customer Name = not X, then category result = "DOMESTIC"

    If Packed location=NA Warehouse AND Shipped to = USA AND Customer Name = X, then category result = "INTERCOMPANY"

    If Customer Name = X, the end result for Category will be "INTERCOMPANY"

    If Packed location=NA Warehouse and Shipped to = non-USA AND Customer Name = not X, then category result = "INTERNATIONAL"

    If (Packed location=SG Warehouse OR HK warehouse) and (Shipped to = non-USA or USA) and (Customer Name = not X) and Received location = SG Warehouse or HK Warehouse then category result = "OUT-OF-SCOPE"
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    42,086

    Re: Help for IF conditions with multiple Conditions (scenario more than 5 conditions)

    You have trailing spaces in column K, so try this:

    =IF(N2="X","INTERCOMPANY",IF(AND(L2="NA Warehouse",LEFT(K2,3)="USA"),"DOMESTIC",IF(AND(L2="NA Warehouse",LEFT(K2,3)<>"USA"),"INTERNATIONAL","OUT-OF-SCOPE")))

    or this:

    =IF(N2="X","INTERCOMPANY",IF(AND(L2="NA Warehouse",TRIM(K2)="USA"),"DOMESTIC",IF(AND(L2="NA Warehouse",TRIM(K2)<>"USA"),"INTERNATIONAL","OUT-OF-SCOPE")))
    Last edited by AliGW; 12-15-2019 at 04:22 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    It changes constantly, but based in Ireland.
    MS-Off Ver
    New learning curve! Office 365
    Posts
    25,408

    Re: Help for IF conditions with multiple Conditions (scenario more than 5 conditions)

    Ooops. left out a condition... and Ali got there, anyway.

    Reply withdrawn.
    Glenn



  4. #4
    Registered User
    Join Date
    12-13-2019
    Location
    Singapore
    MS-Off Ver
    Office365
    Posts
    15

    Re: Help for IF conditions with multiple Conditions (scenario more than 5 conditions)

    Hi Ali

    if column N (customer Name) consist 3 customers which are classified as "INTERCOMPANY" for example X, Y, Z:

    Can I use function "OR" on the 1st condition IF(N2="X","INTERCOMPANY" ?


    I tried this formula works well.

    =IF(N2="X","INTERCOMPANY",IF(AND(L2="NA Warehouse",LEFT(K2,3)="USA"),"DOMESTIC",IF(AND(L2="NA Warehouse",LEFT(K2,3)<>"USA"),"INTERNATIONAL","OUT-OF-SCOPE")))
    Last edited by meily_o26; 12-15-2019 at 07:31 AM.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    42,086

    Re: Help for IF conditions with multiple Conditions (scenario more than 5 conditions)

    Why didn't you say this in the first place?

    Try this:

    =IF(OR(N2="X","Y","Z"),"INTERCOMPANY",IF(AND(L2="NA Warehouse",LEFT(K2,3)="USA"),"DOMESTIC",IF(AND(L2="NA Warehouse",LEFT(K2,3)<>"USA"),"INTERNATIONAL","OUT-OF-SCOPE")))

  6. #6
    Registered User
    Join Date
    12-13-2019
    Location
    Singapore
    MS-Off Ver
    Office365
    Posts
    15

    Re: Help for IF conditions with multiple Conditions (scenario more than 5 conditions)

    Hi Ali

    It's my bad, when preparing that case, I missed out one condition. Thank you so much

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    42,086

    Re: Help for IF conditions with multiple Conditions (scenario more than 5 conditions)

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

+ 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] Help combining macros to delete rows on conditions and add data into cells on conditions
    By JayJayGC in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-03-2017, 10:14 AM
  2. [SOLVED] Advanced Filter Between Two Columns all OR conditions (4 conditions)
    By nobodyukno in forum Excel General
    Replies: 2
    Last Post: 02-16-2017, 01:13 PM
  3. Replies: 2
    Last Post: 01-14-2016, 03:53 PM
  4. [SOLVED] Vlookup - Country conditions (Multiple conditions)
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-26-2013, 11:42 AM
  5. [SOLVED] Text results with two conditions (lookup with two conditions)
    By Davzx in forum Excel General
    Replies: 8
    Last Post: 05-25-2012, 03:08 AM
  6. convert the if conditions to OR conditions
    By nynamyna in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-09-2011, 06:41 PM
  7. [SOLVED] How to multiple conditions to validate more than 2 conditions to .
    By Bhuvana Govind in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2005, 04:06 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