+ Reply to Thread
Results 1 to 8 of 8

IF(AND(OR fx with positive and negative number range

Hybrid View

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    63

    IF(AND(OR fx with positive and negative number range

    Screenshot 2019-04-24 10.19.58.png

    How do you write a proper IF(AND(OR fx in cells D2 thru D5 that states:
    if the number in column B is >0, AND
    the number in column c is >-150, <-109 OR >109, <150,
    then cells D2 thru D5 populates a 1 if it does, and a "" if it doesn't?


    Thanks in advance for any help!
    Last edited by brose99; 04-24-2019 at 06:55 PM.

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

    Re: Simple IF(AND(OR fx question

    Hi

    first attempt...

    =IF(B2<=0,"",IF(OR(AND(C2>-150,C2<-109),AND(C2>109,C2<150)),1,""))

    Regards
    -----------------------------------------------------

    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.

  3. #3
    Registered User
    Join Date
    11-15-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    63

    Re: Simple IF(AND(OR fx question

    Quote Originally Posted by canapone View Post
    Hi

    first attempt...

    =IF(B2<=0,"",IF(OR(AND(C2>-150,C2<-109),AND(C2>109,C2<150)),1,""))

    Regards
    Canapone,

    Your first Fx worked like a charm, but I need to make a simple modification to it, and every attempt I've made has been unsuccessful.

    I need amend the Fx so if the figure in cell B2 is between 0 ><50, AND if cell in C2 >-150, C2<-109 OR C2>109, C2<150, then D2 = 1, if not D2 stays blank.

    I know its a simple fix, but I've made several unsuccessful attempts and was hoping you could help me one last time...or anyone else for that matter.

    Thanks in advance for your help!

  4. #4
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,484

    Re: Simple IF(AND(OR fx question

    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.

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.85 for Mac MS 365
    Posts
    8,513

    Re: Simple IF(AND(OR fx question

    I've tried this one =IF(AND(B2>0,AND(ABS(C2)<150,ABS(C2)>109)),1,"")
    and this one (which is closer to what you wrote) =IF(OR(AND(B2>0,AND(C2>-150,C2<-109)),AND(B2>0,AND(C2>109,C2<150))),1,"")
    and I get only one set that comes back as 1 for both.
    What results do you expect?
    AND possibly more important, is this supposed to be some kind of statement that covers B2 through C5 or is this done line by line (which the two I wrote would do) because your wording makes it sound like it needs to cover the whole range instead of line by line?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  6. #6
    Registered User
    Join Date
    11-15-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    63

    Re: Simple IF(AND(OR fx question

    The thread title is exactly what I was describing and I've had two forum members help me achieve my answer rather quickly so I'm not sure what the problem is.

    Regardless, I got what I needed.

    Thank you canapone and Sambo kid!!!

  7. #7
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,484

    Re: IF(AND(OR fx with positive and negative number range

    The thread title is exactly what I was describing and I've had two forum members help me achieve my answer rather quickly so I'm not sure what the problem is.
    Read my instructions again:

    Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).
    You have now changed it suitably - thanks. Please bear these guidelines in mind next time you create a thread. Think Google search terms when creating titles.

    Try this:

    =IF(AND(B2>0,B2<50,OR(AND(C2>-150,C2<-109),AND(C2>109,C2<150))),1,"")

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Last edited by AliGW; 04-25-2019 at 01:19 AM.

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

    Re: IF(AND(OR fx with positive and negative number range

    Administrative Note:

    It has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

+ 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. simple question.. i think
    By argoguy in forum Excel General
    Replies: 2
    Last Post: 03-23-2007, 07:28 PM
  2. A simple question requiring a simple answer
    By Pedros in forum Excel General
    Replies: 3
    Last Post: 07-18-2006, 06:45 AM
  3. Very simple question.
    By Fenneth in forum Excel General
    Replies: 3
    Last Post: 04-19-2006, 03:00 PM
  4. [SOLVED] a very simple question
    By [email protected] in forum Excel General
    Replies: 6
    Last Post: 11-06-2005, 10:55 AM
  5. [SOLVED] Simple Simple Excel usage question
    By BookerW in forum Excel General
    Replies: 1
    Last Post: 06-23-2005, 05:05 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