+ 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
    13

    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
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,432

    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!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    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 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: 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,189

    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 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    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,189

    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)

Similar Threads

  1. [SOLVED] IF statement with IF Statement as logical test, and output if false
    By wetbean in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-19-2018, 12:59 PM
  2. Replies: 2
    Last Post: 07-09-2015, 04:25 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

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