+ Reply to Thread
Results 1 to 3 of 3

Need help with IF, AND function

  1. #1
    Registered User
    Join Date
    08-31-2013
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Need help with IF, AND function

    Hello,

    I need to use multiple IF and AND functions in an Excel formula. What I need is that if anyone were to enter a certain number within the ranges as mentioned below:
    If number falls within range <=105, then give result "100"
    If number falls within range >105, <=120, then give result "110"
    If number falls within range >120, <=142, then give result "135"
    If number falls within range >142, <=165, then give result "150"
    If number falls within range >165, <=190, then give result "180"
    If number falls within range >190, <=210, then give result "200"
    If number falls within range >210, then give result "Not in Range"

    my result should pick up the corresponding value. I need to integrate this formula on my website. I've been trying my luck with the formula, though I'm constantly getting an error message. Not sure where I am going wrong. Any help would be appreciated! Thanks..

    The formula I used was something like:
    =if(A1<=105),"100",if((AND(A1>105,A1<=120),"110",if((AND(A1>120,A1<=142),"135",if((AND(A1>142,A1<=165),"150",if((AND(A1>165,A1<=190),"180",if((AND(A1>190,A1<=210),"200"),""))))))))))))

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Need help with IF, AND function

    For the second criterion, as you have already tested for the first then you don't need to test for it again. So, you can do this:

    =if(A1<=105,"100",if(A1<=120,"110",if(A1<=142,"135",if(A1<=165,"150",if(A1<=190,"180",if(A1<=210,"200",""))))))

    You should note that the numbers returned will be text values as you have enclosed them within quotes - if you need proper numbers then remove the quotes.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-31-2013
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Need help with IF, AND function

    Perfect! Thanks Pete!

+ 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. index function error using match function to get data from a cell in an array
    By mabildgaard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2013, 02:21 AM
  2. [SOLVED] Using Offset function as the array in the PercentRank function is giving wrong result
    By Bobneil in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-06-2013, 09:29 PM
  3. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  4. Replies: 2
    Last Post: 03-20-2009, 01:29 PM
  5. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 PM

Tags for this Thread

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