+ Reply to Thread
Results 1 to 20 of 20

IF AND OR Multi Criteria Formula help

  1. #1
    Registered User
    Join Date
    03-09-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Microsfot Excel for Office 365 MSO 32-bit
    Posts
    10

    IF AND OR Multi Criteria Formula help

    Hello everyone,

    Please go easy on me, I'm new to the forum and very much a self taught (basic) user of excel, most of which is done by trial and error!

    Long story short, I have a large workbook which is used for reporting purposes. I have an instance where I need to update a formula to take into consideration various different inputs and don't know how to combine them.

    In short, my criteria is as follows;

    IF K12=”D*”OR”L*” AND O12=”C*”,L12*100
    IF K12=”D*”OR”L*” AND O12=”R*”,L12*150
    IF K12=”D*”OR”L*” AND O12=””,L12*150
    IF K12=”M*”,L12*20)

    I am using this formula at the moment, =IFS(O12="C*",L12*100,O12="R*",L12*150,O12="",L12*150) but due to the addition of the 4th criteria as listed above, I need to add Column K to the formula and don't know how to do so.

    Any help would be most gratefully received.

    Regards,

    Lee
    Last edited by Lee Anderson; 03-09-2020 at 12:29 PM. Reason: Move to solved

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Formula Help Please

    I don't have ifs on this pc so untested

    =IFS(and(or(k12="D*", k12="L*"), O12="c*"),L12*100, and(or(k12="D*", k12="L*"), or(O12="r*",o12=””)),L12*150 , K12=”M*”, l12*50)
    Last edited by davsth; 03-09-2020 at 09:02 AM.

  3. #3
    Registered User
    Join Date
    03-09-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Microsfot Excel for Office 365 MSO 32-bit
    Posts
    10

    Re: Formula Help Please

    Quote Originally Posted by davsth View Post
    I don't have ifs on this pc so untested

    =IFS(and(or(k12="D*", k12="L*"), O12="c*"),L12*100, and(or(k12="D*", k12="L*"), or(O12="r*",o12=””)),L12*150 , K12=”M*”, l12*50)
    Hi davsth,

    Thanks very much for replying. The formula above is giving me a #NAME? error - I've checked everything and it all seems correct. Any ideas?

    Thanks,

    Lee

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Formula Help Please

    Hi Lee,

    If you are really using Excel 2016, how are you getting IFS as a function. I don't see that.

    Anyway, please take a look at our forum rules and craft a better title for your query.
    HTH
    Regards, Jeff

  5. #5
    Registered User
    Join Date
    03-09-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Microsfot Excel for Office 365 MSO 32-bit
    Posts
    10

    Re: Formula Help Please

    Quote Originally Posted by jeffreybrown View Post
    Hi Lee,

    If you are really using Excel 2016, how are you getting IFS as a function. I don't see that.

    Anyway, please take a look at our forum rules and craft a better title for your query.
    Hi Jeff,

    Sorry, I'm using Microsfot Excel for Office 365 MSO 32-bit.

    I'll look at the rules again and edit my thread title.

    Regards,

    Lee

  6. #6
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Formula Help Please

    Hi

    an attempt:


    Please Login or Register  to view this content.

    K12 O12...are sufficient

    Please Login or Register  to view this content.




    Regards
    Last edited by canapone; 03-09-2020 at 09:43 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  7. #7
    Registered User
    Join Date
    03-09-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Microsfot Excel for Office 365 MSO 32-bit
    Posts
    10

    Re: Formula Help Please

    Quote Originally Posted by canapone View Post
    Hi

    an attempt:


    Please Login or Register  to view this content.

    K12 O12...are sufficient

    Please Login or Register  to view this content.




    Regards
    Thanks canapone, unfortunately I'm getting a prompt with "there's a problem with this formula". I appreciate your efforts though - this is driving me nuts!

  8. #8
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: IF AND OR Multi Criteria Formula help

    Ciao

    no problem.

    Please refer to the attachment


    Formulas are in B12:B17
    Attached Files Attached Files

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: IF AND OR Multi Criteria Formula help

    Administrative Note:

    Please don't quote entire posts unnecessarily. They clutter threads and make them hard to read.
    Use the "Quick reply" instead
    Thanks

  10. #10
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: IF AND OR Multi Criteria Formula help

    A key question is are you looking for anything starting with for example a C or the exact characters C*


    you have also not put brackets around your conditions IF K12=”D*”OR”L*” AND O12=”C*”,L12*100 could be sasitifed by the 2 lines below
    k12="D*"
    k12="L*" and O12="C*"

    or
    (K12=”D*” OR K12=”L*”) AND O12=”C*”

    A small sample will probably get you your answer, especially if you include expected results
    Last edited by davsth; 03-09-2020 at 10:47 AM.

  11. #11
    Registered User
    Join Date
    03-09-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Microsfot Excel for Office 365 MSO 32-bit
    Posts
    10

    Re: IF AND OR Multi Criteria Formula help

    The expanded criteria is as follows:

    C*: Cash Bank Transfer
    R*: Staff Room (Wallet Credit)
    L*: Laptop
    D*: Desktop
    M*: Monitor

    Your formula works in the following circumstances;

    K12 = Laptop & O12 = Staff Room (Wallet Credit). It also works when K12 = Laptop & O12 = Cash Bank Transfer. It also works when O12 is blank (these are the only 3 options in the drop down list).

    The #NAME? error occurs when I select a different option in K12 (the drop down list can only be Laptop, Desktop, or Monitor).

    I've checked my lists and checked the spelling but still can't get round the error when anythign other than Laptop is selected in K12.

  12. #12
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: IF AND OR Multi Criteria Formula help

    Perhaps post a sample sheet ( see yellow banner) ?

  13. #13
    Registered User
    Join Date
    03-09-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Microsfot Excel for Office 365 MSO 32-bit
    Posts
    10

    Re: IF AND OR Multi Criteria Formula help

    Here is a sample sheet (I've edited and removed confidential data).
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: IF AND OR Multi Criteria Formula help

    I don't have ifs on my PC here but
    =_xlfn.IFS(AND(OR(K12="Desktop", K12="Laptop"), O12="Cash Bank Transfer"),L12*100, AND(OR(K12="Deskptop", K12="Laptop"), OR(O12="Staff Room (Wallet Credit)",O12=””)),L12*150, K12=”Monitor”, L12*20)

    is the extra character the problem

  15. #15
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: IF AND OR Multi Criteria Formula help

    GOT IT !

    In your formula, you have two different type of double quotes like O12=”” and "Laptop"
    The first kind ” should be replaced everywhere with the straight double quotes " in various places in the formula
    This is what triggers the NAME error
    Last edited by Pepe Le Mokko; 03-09-2020 at 12:14 PM.

  16. #16
    Registered User
    Join Date
    03-09-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Microsfot Excel for Office 365 MSO 32-bit
    Posts
    10

    Re: IF AND OR Multi Criteria Formula help

    Quote Originally Posted by Pepe Le Mokko View Post
    In your formula, you have two different type of double quotes like O12=”” and "Laptop"
    The first kind ” should be replaced everywhere with the straight double quotes " in various places in the formula
    This is what triggers the NAME error
    That's it!!! Thank you!!

    I was working across PC and Mac on the same sheet (day and night), I wonder if that's where my error has come from.

    Thank you again!!

  17. #17
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: IF AND OR Multi Criteria Formula help

    Good spot Pepe! sharper eyes than me

  18. #18
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: IF AND OR Multi Criteria Formula help

    And now back to SKYRIM

  19. #19
    Registered User
    Join Date
    03-09-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Microsfot Excel for Office 365 MSO 32-bit
    Posts
    10

    Re: IF AND OR Multi Criteria Formula help

    Thanks for building the formula for me davsth!

  20. #20
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: IF AND OR Multi Criteria Formula help

    Quote Originally Posted by davsth View Post
    Good spot Pepe! sharper eyes than me
    At almost 70? I doubt it . The "Evaluate formula" tool put me on track...

+ 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. Replies: 3
    Last Post: 01-10-2019, 09:34 AM
  2. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  3. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  4. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  5. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  6. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 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