+ Reply to Thread
Results 1 to 4 of 4

IF and AND functions on Excel

  1. #1
    Registered User
    Join Date
    06-19-2014
    Location
    london
    MS-Off Ver
    vista
    Posts
    2

    IF and AND functions on Excel

    How do I write an IF statement that makes sure a cell's value is between two numbers.

    For instance:

    Check whether 0.9 exceeds a range between 0.2 and -0.2.

    If it is larger than this range, then keep I would like to keep this number.
    If it is smaller and falls between this range, I would like turn it into a 0.

    Any help would be appreciated

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: IF and AND functions on Excel

    If it is smaller and falls between this range, I would like turn it into a 0.
    Are you looking for smaller than -.2 or between the range .2 and -.2

    This statement is confusing.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-19-2014
    Location
    london
    MS-Off Ver
    vista
    Posts
    2

    Re: IF and AND functions on Excel

    Apologies, I want to check whether a number falls between -0.2 and 0.2.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: IF and AND functions on Excel

    Assume your test number is in A1, then in A2 =if(and(A1>-.2,A1<.2),0,A1)

    This will return zero if the value in A1 is between your criteria. It will return the value in A1 for all other results.

+ 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. Which Excel functions work in user-defined functions ?
    By RogeratCCCC in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 04-28-2012, 06:47 PM
  2. Replies: 1
    Last Post: 02-10-2012, 05:27 PM
  3. excel functions similar/the same as VBA functions
    By FRIEL in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2008, 05:39 AM
  4. Replies: 0
    Last Post: 11-15-2007, 05:24 AM
  5. [SOLVED] User-defined functions created in Excel 2000 fail in Excel 2003
    By goodguy in forum Excel General
    Replies: 1
    Last Post: 10-03-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