+ Reply to Thread
Results 1 to 5 of 5

IF function with multiple inequalities

  1. #1
    Registered User
    Join Date
    03-24-2015
    Location
    US
    MS-Off Ver
    2010
    Posts
    5

    IF function with multiple inequalities

    Hey guys first time posting...

    Trying to find a way to write an if function with multiple inequalities i.e.

    if cell 0<a1<5 display 60, 5<a1<8 display 120, 8<a1<20 display 140

    not sure what the best way to go about this is but essentially Im dealing with employee vacation accruals and employees who have been at the company in different ranges accrue different numbers of vacation days throughout the year.

    Thank You!

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

    Re: IF function with multiple inequalities

    In A1 try..

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards!
    =DEC2HEX(3563)

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

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

    Re: IF function with multiple inequalities

    You can string a number of IF functions together to achieve that, like this:

    =IF(A1<5,60,IF(A1<8,120,IF(A1<20,140,"other_value")))

    but if you have a lot of categories it would be better to set up a little table and use VLOOKUP.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    03-24-2015
    Location
    US
    MS-Off Ver
    2010
    Posts
    5

    Re: IF function with multiple inequalities

    Thanks Pete

    =IF(P623<365,(P623/365)*120,IF(P623<1095.25,120,IF(P623<1826,160,IF(P623>1826,200,"FALSE"))))

    ended up using this worked fine

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

    Re: IF function with multiple inequalities

    Okay, glad you got your answer. Strictly speaking, you don't need to put quotes around FALSE.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    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. Set of inequalities
    By simosamkun in forum Excel General
    Replies: 6
    Last Post: 05-22-2014, 05:33 PM
  2. Help with VBA loops to find inequalities?
    By hadamhiram in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-30-2013, 10:53 PM
  3. Inequalities question.
    By jaredhawco in forum Excel General
    Replies: 2
    Last Post: 11-03-2008, 02:54 PM
  4. Graphing inequalities
    By miss meliss in forum Excel General
    Replies: 1
    Last Post: 04-30-2006, 04:50 AM
  5. [SOLVED] Can you use two inequalities with the IF function ie IF 10<E5<20.
    By CRICKETERRY in forum Excel General
    Replies: 4
    Last Post: 01-28-2005, 02:06 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