+ Reply to Thread
Results 1 to 7 of 7

Having trouble with a formula that involves IF, AND and maybe OR.

  1. #1
    Registered User
    Join Date
    10-24-2020
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    16

    Having trouble with a formula that involves IF, AND and maybe OR.

    Having trouble with this IF AND OR formula. What I'm trying to come up with is this:

    If Sheet1!D3=B4 and if Sheet1!E3<=C4 and if Sheet1!E3>=D4 and if Sheet1!F3<>E4 and if Sheet1!J3<=G4 and if Sheet1!K3=H4 and if Sheet1!N3<=I4 and if Sheet1!O3=J4 and if Sheet1!C3<=K4 and IF Sheet1!C3 is equal to 2 OR 3 THEN THIS Sheet1!Q3<=L4 and if Sheet1!T3<=M4 and if Sheet1!T3>=N4 THEN PUT "YES", OTHERWISE PUT "NO"

    So, What I'm looking for is either Yes or No to show up. But I've been having trouble when it comes to this part: and IF Sheet1!C3 is equal to 2 OR 3 THEN THIS Sheet1!Q3<=L4

    What I'm stuck on with that part is I don't know how to make it do this equation: Sheet1!Q3<=L4, ONLY if Sheet1!C3 is equal to 2 OR 3, and have it nested within the rest of it.

    Can someone help me out with this?

    Thanks.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Having trouble with a formula that involves IF, AND and maybe OR.

    Follow exactly what you said in words, try:

    Please Login or Register  to view this content.
    Quang PT

  3. #3
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Having trouble with a formula that involves IF, AND and maybe OR.

    Not sure if I follow exactly, but try this:

    =IF(AND(Sheet1!D3=B4,Sheet1!E3<=C4,Sheet1!E3>=D4,Sheet1!F3<>E4,Sheet1!J3<=G4,Sheet1!K3=H4,Sheet1!N3<=I4,Sheet1!O3=J4,Sheet1!C3<=K4,Sheet1!Q3<=L4,OR(Sheet1!C3=2,Sheet1!C3=3),Sheet1!T3<=M4, Sheet1!T3>=N4),"YES","NO")

  4. #4
    Registered User
    Join Date
    10-24-2020
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    16

    Re: Having trouble with a formula that involves IF, AND and maybe OR.

    Thanks, but it still isn't what I'm looking for. The main part I'm trying to get it to do is include this in the formula: Sheet1!Q3<=L4 ONLY if Sheet1!C3 is equal to 2 OR 3. So, I need all the requirements to be true, but only require the Sheet1!Q3<=L4 to be true IF Sheet1!C3 is equal to 2 OR 3. If that makes sense. This is the only part I'm stuck on.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Having trouble with a formula that involves IF, AND and maybe OR.

    This part could be:
    AND(Sheet1!Q3<=L4,OR(Sheet1!C3=2,Sheet1!C3=3))

  6. #6
    Registered User
    Join Date
    10-24-2020
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    16

    Re: Having trouble with a formula that involves IF, AND and maybe OR.

    The only problem is, if Sheet1!C3 equals something other than 2 or 3, I still need it to give a "Yes".

    If I test it and change Sheet1!C3 to "1", the formula gives a "No".

    I need it to do Sheet1!Q3<=L4, only if Sheet1!C3=2,Sheet1!C3=3, OTHERWISE ignore the Sheet1!Q3<=L4. If that makes sense.

  7. #7
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Having trouble with a formula that involves IF, AND and maybe OR.

    =IF(AND(Sheet1!D3=B4,Sheet1!E3<=C4,Sheet1!E3>=D4,Sheet1!F3<>E4,Sheet1!J3<=G4,Sheet1!K3=H4,Sheet1!N3<=I4,Sheet1!O3=J4,Sheet1!C3<=K4,OR(AND(Sheet1!Q3<=L4,OR(Sheet1!C3=2,Sheet1!C3=3)),AND(Sheet1!C3<>2,Sheet1!C3<>3)),Sheet1!T3<=M4, Sheet1!T3>=N4),"YES","NO")

+ 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: 08-15-2019, 10:24 AM
  2. Formula CleanUp Needed involves IF, IFERROR, VLOOKUP, OFFSET
    By tbone812 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-06-2018, 10:25 PM
  3. [SOLVED] Formula assistance to perform multiple tasks which involves ranges that cover two sheets
    By lilsnoop in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-30-2014, 12:14 PM
  4. [SOLVED] Writing out a list of wildcards in a formula? involves COUNTIF
    By jasonbwt in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-26-2012, 09:42 AM
  5. Replies: 1
    Last Post: 02-02-2012, 03:08 AM
  6. Trouble using a macro in excel that involves Powerpoint
    By Milhannibal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2011, 07:32 AM
  7. Looking for formula that involves 2 columns
    By gerryger in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-03-2009, 06:48 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