+ Reply to Thread
Results 1 to 12 of 12

If formula greater than a series of numbers

  1. #1
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    If formula greater than a series of numbers

    Thank you for viewing my post.

    I am trying to calculate a set of If calculation for one cell but can't seem to get it right.

    If A1 is greater than 105 through 109.9 then I would like B1 to = 1. If it is greater than 110, then B1 should = 2
    =IF(A1>105-109.9,1,IF(A1>110,2))


    Thank you,
    -Newb

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

    Re: If formula greater than a series of numbers

    Do it like this in B1:

    =IF(A1>=110,2,IF(A1>=105,1,0))

    I've assumed you want zero for values of A that are less than 105.

    Hope this helps.

    Pete

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If formula greater than a series of numbers

    Try:

    =IF(A1>=110,2,IF(A1>=105,1,0)) you can nest more

    or

    =LOOKUP(A1,{105,110},{1,2}) you can insert more..
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Re: If formula greater than a series of numbers

    Hello,

    Thank you for replying to me. When I put in that formula, I get 2 in column B1 instead of 1. The number is 105%.

    Thank you,
    Newb


    Quote Originally Posted by Pete_UK View Post
    Do it like this in B1:

    =IF(A1>=110,2,IF(A1>=105,1,0))

    I've assumed you want zero for values of A that are less than 105.

    Hope this helps.

    Pete


    ---------- Post added at 09:39 AM ---------- Previous post was at 09:35 AM ----------

    I tried both formulas, but the results for all cells come out to be 2. Even though a1 is listed as 105.0%, it still says 2.

    Quote Originally Posted by NBVC View Post
    Try:

    =IF(A1>=110,2,IF(A1>=105,1,0)) you can nest more

    or

    =LOOKUP(A1,{105,110},{1,2}) you can insert more..

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If formula greater than a series of numbers

    If you are dealing with percentages, then try:

    =LOOKUP(A1,{1.05,1.1},{1,2})

  6. #6
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Re: If formula greater than a series of numbers

    Shows #NA.......

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If formula greater than a series of numbers

    Did you change the A1 to reference your cell of interest?

    or is your lookup value less than 105%? If so, what do you need returned?

  8. #8
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Re: If formula greater than a series of numbers

    if it is less than 105 it should be 0.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If formula greater than a series of numbers

    =lookup(a1,{0,1.05,1.1},{0,1,2})

  10. #10
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Re: If formula greater than a series of numbers

    Thanks I used another method.

    =IF(AND(I21<105%),"0",IF(AND(I21>=105%,I21<=109.9%),"1",IF(AND(I21>=110%),"2",)))

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If formula greater than a series of numbers

    It's your choice...

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

    Re: If formula greater than a series of numbers

    Quote Originally Posted by newbie4 View Post
    Thanks I used another method.

    =IF(AND(I21<105%),"0",IF(AND(I21>=105%,I21<=109.9%),"1",IF(AND(I21>=110%),"2",)))
    If Excel gets past the first IF (where your AND is not doing anything), then you don't need to test for I21 being greater than or equal to 105% as you have already tested for it being less than 105%. Similarly, you don't need to test for I21 being greater than or equal to 110%, as you have already tested for it being less than or equal to 109.9%. (Actually, there is thus a small range of between 109.9% and 110% exclusive that you do not test for). So, the following will do the job and be more efficient:

    =IF(I21<105%,"0",IF(I21<=110%,"1","2"))

    although I suspect you would prefer to have real numbers rather than text representations of numbers, so you can remove the double-quotes as well.

    Hope this helps.

    Pete

+ 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