+ Reply to Thread
Results 1 to 8 of 8

Determine if whole number exists between a minimum and maximum value

  1. #1
    Registered User
    Join Date
    11-25-2011
    Location
    Ottawa
    MS-Off Ver
    Excel 2010
    Posts
    2

    Determine if whole number exists between a minimum and maximum value

    This is my first post and I'm hoping someone might be able to point me in the right direction. I have two columns of data with a minimum value in the first column and a maximum value in the second column. What I'm trying to get is an indicator in a third column which tells me if a whole number falls at or between the minimum and maximum values. Here is a sample of my data:

    A1 B1 C1
    0 0.1 TRUE
    0.2 0.5 FALSE
    0.6 0.8 FALSE
    0.9 1.2 TRUE
    1.3 1.6 FALSE
    1.7 2.0 TRUE

    Thank you in advance!

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Determine if whole number exists between a minimum and maximum value

    Why is C1 TRUE.............there is no whole number between zero and 0.1
    Last edited by Jakobshavn; 02-14-2014 at 10:43 AM.
    Gary's Student

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Determine if whole number exists between a minimum and maximum value

    In C1 try this formula copied down

    =OR(INT(A1)<>INT(B1),CEILING(A1,1)<>CEILING(B1,1))
    Audere est facere

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Determine if whole number exists between a minimum and maximum value

    "...there is no whole number between zero and 0.1"

    Considering that zero is defined as an integer, there may be, though that depends on whether the OP's definition of "between" includes or excludes the minimum and maximum.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    11-25-2011
    Location
    Ottawa
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Determine if whole number exists between a minimum and maximum value

    Thank you very much daddylonglegs your formula produced the result I was expecting! Thanks to all who replied. I should have said integer instead of whole number in my original post.

  6. #6
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Determine if whole number exists between a minimum and maximum value

    Perhaps:

    =ROUNDUP(A1,0)<=B1

  7. #7
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Determine if whole number exists between a minimum and maximum value

    @daddylonglegs, assuming it is a valid entry, that method would return false for :
    A1=1
    B1=1

    maybe:
    =OR(MOD(A1,1)=0,MOD(B1,1)=0,MOD(B1,1)-MOD(A1,1)<0,B1-A1>=1)

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Determine if whole number exists between a minimum and maximum value

    Quote Originally Posted by Jakobshavn View Post
    =ROUNDUP(A1,0)<=B1
    Looks good to me! (and would also fix the issue that yudlugar raises)

+ 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. Color maximum and Minimum
    By thong127 in forum Excel General
    Replies: 6
    Last Post: 01-09-2014, 11:20 AM
  2. Replies: 2
    Last Post: 10-17-2013, 02:57 PM
  3. [SOLVED] Getting the maximum & Minimum value in a range
    By Navin Agrawal in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-13-2013, 12:39 PM
  4. Maximum and Minimum
    By lurchybold in forum Excel General
    Replies: 6
    Last Post: 10-13-2010, 11:04 AM
  5. [SOLVED] Recording maximum and minimum
    By F in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2006, 02:30 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