+ Reply to Thread
Results 1 to 6 of 6

Multiple IF Statements / Equal to Greater than etc.

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Multiple IF Statements / Equal to Greater than etc.

    Hello - looking for assistance writing this:

    IF A1 is equal to 5 but less than or equal to 20, then 3
    IF A1 is equal to 21 but less than or equal to 40, then 2
    IF A1 is equal to or greater than 41, then 1

    Alternately, can this be done through conditional formatting? Specifically, I would like to highlight an entire row if the above range conditions apply - i don't necessarily need the 3,2,1 ranking if this is the case.

    Thanks!

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Multiple IF Statements / Equal to Greater than etc.

    Try this in B1

    =INDEX({3,2,1},MATCH(A1,{5,21,41}))

    or this

    =LOOKUP(A1,{5,21,41},{3,2,1})

    A
    B
    1
    5
    3
    2
    21
    2
    3
    30
    2
    4
    41
    1
    Last edited by AlKey; 06-06-2014 at 01:50 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Multiple IF Statements / Equal to Greater than etc.

    I have assumed that instead of "equal to 5 but less than or equal to 20",, etc, you meant to say
    "greater than or equal to 5 and less than or equal to 20"
    .
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If that's correct - this will work. If I've misunderstood you, please tell me!
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Registered User
    Join Date
    03-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Multiple IF Statements / Equal to Greater than etc.

    Thank you Glenn - it works perfect!! Have a good day.

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,690

    Re: Multiple IF Statements / Equal to Greater than etc.

    was going to add that if you want a simple if then stmt, this should do it for you for what it's worth...
    =IF(AND(A1>4,A1<21),3,IF(AND(A1>20,A1<41),2,IF(A1>40,1,"")))
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Multiple IF Statements / Equal to Greater than etc.

    Cheers, Jeff (notorious or otherwise...).

+ 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. SumIfs containing a greater than or equal to And less than or equal to
    By teton88 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-15-2014, 07:47 PM
  2. [SOLVED] COUNTIFS function w/greater than or equal to, and less than or equal to time values
    By AliciaRenee in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-27-2014, 03:57 PM
  3. Replies: 3
    Last Post: 10-10-2012, 06:37 AM
  4. [SOLVED] Conditional Formatting + IF statements + Greater than or equal to
    By tiggynook in forum Excel General
    Replies: 2
    Last Post: 08-09-2012, 01:32 PM
  5. Multiple IF's/Greater than, smaller than, equal to.
    By Aileanor in forum Excel General
    Replies: 4
    Last Post: 11-21-2011, 11:29 AM

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