Closed Thread
Results 1 to 19 of 19

help with if then function for ranges

  1. #1
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Angry help with if then function for ranges

    L5 needs to display 80 if k5 equals .1 to 4, 60 if k5 equals 4.1 to 8, 40 if it equals 8.1 to 12, 30 if 12.1 to 16, 20 if 16 +. i am new to excel, and i have excel 2000. it is driving me insane please help

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: help with if then function for ranges

    try this

    =if(and(K5>=.1,K5<=4),80,if(and(K5>=4.1,K5<=8),60,if(and(K5>=8.1,K5<=12),40,if(and(K5>=12.1,K5<=16),30,20))))

    or

    =if(K5>16,20,if(k5>12.1,30,if(K5>8.1,40,if(k5>4.1,60,if(K5>.1,80,"Too Small")))))
    Last edited by DGagnon; 03-14-2012 at 09:28 PM.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: help with if then function for ranges

    in L5

    =LOOKUP(K5,{0.1,4.1,8.1,12.1,16.1},{80,60,40,30,20})
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: help with if then function for ranges

    A shorter IF function can be obtained by testing for highest numbers first, ie

    =IF(K5>16.1,20,IF(K5>12.1,30,IF(K5>8.1,40,IF(K5>4,1,60,80))))

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: help with if then function for ranges

    Give this a go
    =IF(K5<=4,80,IF(AND(K5>4,K5<=8),60,IF(AND(K5>8,K5<=12),40,IF(AND(K5>12,K5<=16),30,20))))

  6. #6
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    grrrrrrrrrrrrr...........frustrating!!!
    Last edited by janastead; 03-14-2012 at 09:59 PM.

  7. #7
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: help with if then function for ranges

    Did you use the LOOKUP solution?

  8. #8
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    this one only returned 80

  9. #9
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    this one gave an error message for too many arguments

  10. #10
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    this only returns 80 as well ( i really apreciate the help tho!

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: help with if then function for ranges

    Quote Originally Posted by janastead View Post
    this one gave an error message for too many arguments
    Who are you responding to?

  12. #12
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    i used lookup and it yeilded 80 only as well... any other ideas?

  13. #13
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: help with if then function for ranges

    could you share a sample book?

  14. #14
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    excel error.JPG

    here u go

  15. #15
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: help with if then function for ranges

    try this out

    =IF(K5>16.1,20,IF(K5>12.1,30,IF(K5>8.1,40,IF(K5>4.1,60,80))))

  16. #16
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    excel error 2.JPG

    heres another try. it is showing 20 but should be showing 80. it only changes to 80 if it is above 10

  17. #17
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: help with if then function for ranges

    looking at you data again, you are working with %'s not whole numbers, 4% is not equal to 4, but .04

    try this.

    =IF(K5>.161,20,IF(K5>.121,30,IF(K5>.081,40,IF(K5>.041,60,80))))

  18. #18
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    excel error 3.JPG

    another try that ohnly yeilds 80

  19. #19
    Registered User
    Join Date
    03-14-2012
    Location
    lewisville, tx
    MS-Off Ver
    Excel 2000
    Posts
    25

    Re: help with if then function for ranges

    Registered User
    --------------------------------------------------------------------------------
    Join Date: 02-23-2012Location: Ontario, Canada MS-Off Ver: Excel 2003, 2007Posts: 648Infractions:0/1 (2)




    Re: help with if then function for ranges



    looking at you data again, you are working with %'s not whole numbers, 4% is not equal to 4, but .04

    try this.

    =IF(K5>.161,20,IF(K5>.121,30,IF(K5>.081,40,IF(K5>.041,60,80))))

    THANK YOU SO VERY MUCH! THAT WAS THE PROBLEM :
    ))

Closed 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