+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting for more than 3 conditions in Excel 2002

  1. #1
    Registered User
    Join Date
    08-10-2007
    Posts
    2

    Conditional formatting for more than 3 conditions in Excel 2002

    I'm trying to create conditional formatting to turn cell F12 different colours depending on the number in the cell. The rules are:

    Red: >1.2
    Orange: >1.1 to 1.2
    Green: >0.9 to 1.1
    Orange: 0.8 to 0.9
    Red: <0.8

    If I could have 5 conditions, it would be fairly simple, but as I am limited to 3 it means that I need a formula for each of red, orange and green. I've tried but can't seem to get it to work. Any ideas?

    Thanks.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    If you need more than 3 conditional formattings thn try using a worksheet change event macro



    'These instructions pre typed & are worded to cater for the novice programmer
    'To install macro to correct location

    'Copy this macro
    'GoTo Excel
    'Select sheet this is to appy to
    'Right Click on Sheet Name Tab > select View Code
    'Past macro into the Worksheet Module displayed

    Please Login or Register  to view this content.
    Note :-
    In your discription you said > 0.9 to 1.1.
    in the above code that used Case 0.9 To 1.1 without including the >
    This is not a problem as this line of code is executed 1st
    Case 0.8 To 0.9
    which means that if the value of f12 is 0.9 the colour coding for the range 0.8 To 0.9 is used and the colour range for 0.9 to 1.1 is not run

    The same structure also applies for 1.2
    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.

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Quote Originally Posted by catherinemoore
    I'm trying to create conditional formatting to turn cell F12 different colours depending on the number in the cell. The rules are:

    Red: >1.2
    Orange: >1.1 to 1.2
    Green: >0.9 to 1.1
    Orange: 0.8 to 0.9
    Red: <0.8

    If I could have 5 conditions, it would be fairly simple, but as I am limited to 3 it means that I need a formula for each of red, orange and green. I've tried but can't seem to get it to work. Any ideas?

    Thanks.
    In fact in this case you only have 3 conditions, not 5:

    HTML Code: 


    I didn't test the values, you may want to adapt

  4. #4
    Registered User
    Join Date
    08-10-2007
    Posts
    2
    Thanks both. I have used arthurbr's approach to keep it consistent with the conditional formatting I have used elsewhere in the spreadsheet.

+ 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