+ Reply to Thread
Results 1 to 7 of 7

How To Write This =IF Formula

  1. #1
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Ottawa, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    107

    How To Write This =IF Formula

    In cell A1 I would insert value from 0 to 999

    What I'm trying to do is

    If the value of A1 is equal or greater than 0, but equal or less than 333, the answer would be 1
    If the value of A1 is equal or greater than 334, but equal or less than 666, the answer would be 2
    If the value of A1 is equal or greater than 667, but equal or less than 999, the answer would be 3

    Here is how I'ver tried to write it, but no matter what value I put if A1, I keep getting an anwer of 1?

    =IF(A1<=0>=333,1,IF(A1<=334>=666,2,IF(A1<=667>=999,3)))

    Thanks is advance for your help.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How To Write This =IF Formula

    Try a lookup

    =LOOKUP(A1,{0,334,667,1000},{1,2,3,""})

    You didn't specify what should happen if the value is 1000+ or Below Zero.
    So I've assumed the value won't be below 0, and that you want a blank if it's 1000+

    If the value IS below 0 or if it's text, then it will return #N/A

  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: How To Write This =IF Formula

    try This..

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Ottawa... I hope.. no need to swap ";" and "," but if doesn't work.. then swap as suggested..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How To Write This =IF Formula

    One way is this.

    =IF(AND(A1>0,A1<=333),1,IF(AND(A1>=334,A1<=666),2,IF(AND(A1>=667,A1<=999),3,"")))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

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

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Ottawa, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    107

    Re: How To Write This =IF Formula

    Excellent! Thanks for your help all.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How To Write This =IF Formula

    You're welcome.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How To Write This =IF Formula

    ........................

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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