+ Reply to Thread
Results 1 to 7 of 7

Getting an OR statement to work with nested IF Statements

  1. #1
    Registered User
    Join Date
    10-24-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    11

    Getting an OR statement to work with nested IF Statements

    =IF(OR(C224="Kitchen Assistant","Kitchen Chef"),"0",IF(OR(C224="contact Centre","Contact centre 2"),IF(T224>=9,10,IF(T224=8,7.5,IF(T224=7,2.5,"0"))),IF(T224>=9,5,IF(T224=8,3.75,IF(T224=7,1.25,"0")))))

    Hello,

    Im trying to get the above statement to work, however it wont.
    Below is what its started as but then i wanted to add in a OR stament as above so that i can have the inital checks for 2 critira instead of making a huge mess of a formula.

    =IF(C226="Kitchen Assistant","0",IF(C226="contact Centre",IF(T226>=9,10,IF(T226=8,7.5,IF(T226=7,2.5,"0"))),IF(T226>=9,5,IF(T226=8,3.75,IF(T226=7,1.25,"0")))))


    I hope this is explained well enough let me know if i can provide any more information
    Last edited by ciaron178; 08-14-2019 at 10:35 AM. Reason: Title Change

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

    Re: IF or Statement help

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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 Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,188

    Re: Getting an OR statement to work with nested IF Statements

    For your first OR, one of the following

    OR(C224={"Kitchen Assistant","Kitchen Chef"})

    OR(C224="Kitchen Assistant",C224="Kitchen Chef")

    Either will work, just showing you the 2 options that you can use.

  4. #4
    Forum Expert Sambo kid's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    Office 365 ProPlus - work; 2012 for Mac at home
    Posts
    6,163

    Re: Getting an OR statement to work with nested IF Statements

    Apart from what Jason gave you to correct your formula, if you are wanting a zero as the output rather than a text remove the quotes around the 0 so the output is actually numeric.
    IF(OR(C224="Kitchen Assistant","Kitchen Chef"),"0"...
    just a suggestion not knowing how you are using the output.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,188

    Re: Getting an OR statement to work with nested IF Statements

    Goos spot, I missed the text zero's.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    48,590

    Re: Getting an OR statement to work with nested IF Statements

    Another possible option...

    =IF(C224="Kitchen*",0,IF(C224="contact*",IF(T224>=9,10,IF(T224=8,7.5,IF(T224=7,2.5,0))),IF(T224>=9,5,IF(T224=8,3.75,IF(T224=7,1.25,"0")))))

    However, that last part (bolded) looks wrong...
    ...IF(T224>=9,5,IF(T224=8,3.75,IF(T224=7,1.25,"0")))))
    either you are missing an argument after 9.5 or your logic is wrong.
    IF(T224>=9,5...if that part is TRUE, then the next part is not possible. For this to be TRUE, T224 must be >= 9.5, so therefor T224=8 wont be tested, nor would T224=7
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,188

    Re: Getting an OR statement to work with nested IF Statements

    The whole thing looks wrong, Ford!

    I came up with =IF(LEFT(C224,7)="Kitchen",0,LOOKUP(T224,{0,7,8,9},{0,2.5,7.5,10})/IF(LEFT(C224,7)="Contact",2,1)) while I was waiting for the OP to respond to the existing suggestions, but I'm not entirely convinced. Trying to break down messy formulas without knowing what they are meant to be doing is not one of my favourite pastimes.

    Nearly forgot to ask, is the wildcard in a logical test a new feature in an unreleased version of excel? You're the second person to suggest it recently, but I can't get it to work

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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