+ Reply to Thread
Results 1 to 10 of 10

Conditional formatting formula for value between two other values

  1. #1
    Registered User
    Join Date
    12-17-2008
    Location
    Seattle, WA
    Posts
    39

    Conditional formatting formula for value between two other values

    Hi everyone,

    I am having a very difficult time trying to figure out a conditional formatting formula for something that seems very simple.

    There are 3 conditions I would like to apply to cell B2:

    If the value of I2 is less than or equal to 24, but greater than or equal to 21, shade B2 red.

    If the value of I2 is less than or equal to 20, but greater than or equal to 12, shade B2 orange.

    If the value of I2 is less than or equal to 11, but greater than or equal to 8, shade B2 yellow.

    I am sure I am missing something quite simple here. Can anyone point me in the right direction?

    Thanks,
    ACurtis802
    Last edited by ACurtis802; 01-11-2009 at 06:02 PM.

  2. #2
    Registered User
    Join Date
    01-06-2009
    Location
    Tamworth, Australia
    MS-Off Ver
    Excel 2003
    Posts
    21
    go to formatting/conditional formatting. Then in the drop down box in the top left Click "formula is" then type a logical if formula based on your criteria in the box to the right. Then add the next condition,

    Hope that helps

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Use Tony M instructions with these formulas


    For condition 1
    =AND(L2>=21,L2<=24)

    For condition 2
    =AND(L2>=12,L2<=20)

    For condition 3
    =AND(L2>=8,L2<=11)
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  4. #4
    Registered User
    Join Date
    01-06-2009
    Location
    Tamworth, Australia
    MS-Off Ver
    Excel 2003
    Posts
    21
    Just for clarity's sake

    Condition 1: =IF(I2<=24,1," ")+IF(I2>=21,1," ")

    Then go format/paterns then click red

    Conditon 2: =IF(I2<=20,1," ")+IF(I2>=12,1," ")

    Then go format/paterns then click orange

    Condition 3: =IF(I2<=11,1," ")+IF(I2>=8,1," ")

    Then go format/paterns then click yellow

  5. #5
    Registered User
    Join Date
    01-06-2009
    Location
    Tamworth, Australia
    MS-Off Ver
    Excel 2003
    Posts
    21
    Thanks Mudraker, much simpler formula than mine

  6. #6
    Registered User
    Join Date
    12-17-2008
    Location
    Seattle, WA
    Posts
    39
    Thank you both very much.

    The value in cell I2 looks like a number, but it is actually evaluating to text because of a workaround I am using to exceed the 7 nested IF argument limit.

    As such, these formulae do not do the trick exactly. However, using your logic, I am now asking the conditional formatting formula to evaluate based on instances of the text string, e.g., "24" vs 24, and everything is working perfectly.

    Maybe a little clumsy, but problem solved! :-)

  7. #7
    Registered User
    Join Date
    04-09-2013
    Location
    United States
    MS-Off Ver
    Excel 20010
    Posts
    1

    Cool Re: Conditional formatting formula for value between two other values

    FABULOUSLY HELPFUL!!!

    I had never placed a between formula in the conditional formatting - this worked wonderfully, thank you!

    Quote Originally Posted by mudraker View Post
    Use Tony M instructions with these formulas


    For condition 1
    =AND(L2>=21,L2<=24)

    For condition 2
    =AND(L2>=12,L2<=20)

    For condition 3
    =AND(L2>=8,L2<=11)

  8. #8
    Registered User
    Join Date
    06-01-2014
    Posts
    4

    Re: Conditional formatting formula for value between two other values

    I Have a similar issue but with percentage and I am using a cell for the Constance value.

    =OR(B2>B11,B2=B11) (100% or greater)GREEN

    =OR(B2<0.99%,B2>0.9%) (90 to 99%)ORANGE

    =OR(B2<0.89%,B2>0.75%) (75 to 89%)YELLOW

    =B2<0.74% (74% and Below)RED

    Cell B11 holds the Constance Value and Cell B2 will very and change color depending on the percentage of B11


  9. #9
    Registered User
    Join Date
    06-01-2014
    Posts
    4

    Re: Conditional formatting formula for value between two other values

    I am using this with 6 extra cells to give me the percent value

    =OR(B2>B11,B2=B11)

    =AND($B$2<$B$13,$B$2>$B$14)

    =AND($B$2<$B$15,$B$2>$B$16)

    =AND($B$2<$B$17)

    A1 B1
    A2 17
    A3 82
    A4 97
    A5 0.98
    A6 2
    A7 11.8%
    A8 9
    A9 12.8%
    A10 26.7%
    A11 22

    21.78
    19.8
    19.58
    17.6
    17.38
    16.5

    IT WORKS BUT IS THERE A SIMPLER WAY?

  10. #10
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: Conditional formatting formula for value between two other values

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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