+ Reply to Thread
Results 1 to 5 of 5

Why does =if(c7<b2<d7,1,0) not work? A between number sentence....

  1. #1
    Registered User
    Join Date
    08-26-2015
    Location
    Spring, TX
    MS-Off Ver
    Excel 2013
    Posts
    1

    Exclamation Why does =if(c7<b2<d7,1,0) not work? A between number sentence....

    All cells of course have numbers. Lets say b2 is 9; c7 is 0 and d7 is 10. Im asking it to give me a 1 if b2 is between the other 2 cell values and a 0 if false. All I can figure is that "between" is expressed in some other way. I'm sure this is incredibly easy and I'm very frustrated that I'm unable to make it work.

    Initially I was trying to get a true or false on whether one date was inbetween two other dates.... and when that wouldn't worked just tried straight numbers. Can't even get that to work.

    Any help would be greatly appreciated!

    Thanks, Karin

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Why does =if(c7<b2<d7,1,0) not work? A between number sentence....

    Welcome to the board, Karin.

    =if(and(c7<b2, b2<d7), 1, 0)

    or

    =(c7<b2)*(b2<d7)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Re: Why does =if(c7<b2<d7,1,0) not work? A between number sentence....

    try this and see if it works for you:

    =AND(B2>0,B2<10)
    If I've helped U pls click on d *Add Reputation

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Why does =if(c7<b2<d7,1,0) not work? A between number sentence....

    Incorrect syntax. Excel is unable to decypher what you want.
    Maybe something like this:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Why does =if(c7<b2<d7,1,0) not work? A between number sentence....

    "Between" usually means:

    Greater than or equal to X and less than or equal to Y.

    In your case it would be:

    =--AND(B2>=C7,B2<=D7)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. work up to find next number not 0
    By brucey2343 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-22-2023, 05:34 AM
  2. Getting month number from week based on number of "work days"
    By bergsorensen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-11-2014, 07:21 AM
  3. Convert specific number into specific sentence
    By sarangapani in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-26-2013, 03:57 PM
  4. [SOLVED] Match a data entry sentence with the highest number of common words within a database
    By jasonbwt in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 08-13-2012, 01:17 AM
  5. Extracting a number out of a sentence
    By Geomarsh in forum Excel General
    Replies: 17
    Last Post: 08-12-2009, 09:47 PM
  6. Formatting a number within a sentence
    By aalbers in forum Excel General
    Replies: 4
    Last Post: 06-19-2009, 03:51 PM
  7. Replies: 10
    Last Post: 10-07-2005, 03: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