+ Reply to Thread
Results 1 to 5 of 5

Help with IF AND OR

  1. #1
    Registered User
    Join Date
    03-21-2019
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    2

    Help with IF AND OR

    I'm really new at all of this and I've been racking my brain for a while on this. To no avail, I am coming up with errors.

    Here's what I'm trying to do:

    I need to get a cell to read "Flammable" only under these conditions:

    “FLAMMABLE” ONLY IF B22 > 1000, but < 8820

    AND

    “FLAMMABLE” ONLY WHEN B22 is >8820 AND THERE ARE VALUES GREATER THAN 0 in ANY of the following boxes: C22,E22:G22,I22,K22,M22,N22

    Any help would be greatly appreciated!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Help with IF AND OR

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help with IF AND OR

    =IF(or(AND( B22 > 1000, B22 < 8820), and(sum(B22 > 8820, C22,E22:G22,I22,K22,M22,N22)>0)), "FLAMMABLE", "")
    Last edited by mehmetcik; 03-21-2019 at 06:25 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Help with IF AND OR

    I'm confused, but that's fine - ignore me if the following makes no sense.


    For the sake of the following discussion:
    Expression-1 =
    “FLAMMABLE” ONLY IF B22 > 1000, but < 8820

    Expression-2 =
    “FLAMMABLE” ONLY WHEN B22 is >8820 AND THERE ARE VALUES GREATER THAN 0 in ANY of the following boxes: C22,E22:G22,I22,K22,M22,N22

    The required result is Expression-1 AND Expression-2

    If B22>= 8820 then Expression-1 is FALSE and so the whole expression is FALSE

    If B22 < 8820 then Expression-2 is FALSE and so the whole expression is FALSE.

    So in summary we should never get Flammable = TRUE

  5. #5
    Registered User
    Join Date
    03-21-2019
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    2

    Thumbs up Re: Help with IF AND OR

    This worked perfectly mehmetcik , thank you so much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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