+ Reply to Thread
Results 1 to 7 of 7

Need Help. Conditional formatting a cell if between two values or not between

  1. #1
    Registered User
    Join Date
    03-18-2013
    Location
    arden
    MS-Off Ver
    excel 2007
    Posts
    2

    Need Help. Conditional formatting a cell if between two values or not between

    Hi, I have searched all around but cannot get anything to work. What I want to do is create conditional formatting or VBA (with some help) to fill a cell RED if MAX(I4:R4)>MAX(E4:F4), MIN(I4:R4)<MIN(E4:F4) Else fill cell green.
    Im open to any suggestions, solutions. I have a attached a sample of what I would like to do.
    Thanks a head of time.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Need Help. Conditional formatting a cell if between two values or not between

    do both criteria have to be met, or just 1 of them?

    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =OR(MAX(I4:R4)>MAX(E4:F4), MIN(I4:R4)<MIN(E4:F4)) if either is met
    or =and(MAX(I4:R4)>MAX(E4:F4), MIN(I4:R4)<MIN(E4:F4)) if both need to be met
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,305

    Re: Need Help. Conditional formatting a cell if between two values or not between

    Please Login or Register  to view this content.
    You can also use this short formula
    If the result is 'true' then 'green' else 'red'.

    Sorry, this wil only work with one value (i4)not with a range (I4:R4)
    Last edited by popipipo; 03-18-2013 at 03:54 PM.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  4. #4
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Need Help. Conditional formatting a cell if between two values or not between

    Check out the conditional formatting on cells I17 → M17

    Conditional Formatting has a check for "Cell Value Is"
    "between" _____ and _____
    and
    "not between" _____ and _____

    I just selected the cells that are labeled Specification / Limits

    Is that what you are looking for?


    Edit: Note I put $ on the column but not the row number that way you can stretch the cells down to the range you want, if you are so inclined.
    Last edited by Fett2oo5; 03-18-2013 at 04:09 PM.

  5. #5
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Need Help. Conditional formatting a cell if between two values or not between

    Sorry I forgot to set a no color as default see this example for the cell to be blank if no value is entered.

    Check out the conditional formatting on cells I17 → M17

    Cell Value is equal to 0 = blank
    Cell Value is between $E17 and $F17 = Green
    Cell Value is not between $E17 and $F17 = Red
    Attached Files Attached Files
    Last edited by Fett2oo5; 03-18-2013 at 04:11 PM.

  6. #6
    Registered User
    Join Date
    03-18-2013
    Location
    arden
    MS-Off Ver
    excel 2007
    Posts
    2

    Re: Need Help. Conditional formatting a cell if between two values or not between

    Quote Originally Posted by Fett2oo5 View Post
    Sorry I forgot to set a no color as default see this example for the cell to be blank if no value is entered.

    Check out the conditional formatting on cells I17 → M17

    Cell Value is equal to 0 = blank
    Cell Value is between $E17 and $F17 = Green
    Cell Value is not between $E17 and $F17 = Red


    This worked. I guess I was over analyzing it and trying to make it into a more complex if then. I didnt really think about the multiple conditions. Sorry and thanks

  7. #7
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Need Help. Conditional formatting a cell if between two values or not between

    No worries, sometimes it just takes another set of eyes to see it differently.



    Click *, if the suggestion helps you!
    If your problem is solved, then please mark the thread as SOLVED:
    Go to above your first post → Thread Tools → Mark your thread as Solved

+ 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