+ Reply to Thread
Results 1 to 9 of 9

Conditional Formatting Problem

  1. #1
    Registered User
    Join Date
    05-17-2014
    MS-Off Ver
    Excel 2003
    Posts
    15

    Conditional Formatting Problem

    In the attached example spreadsheet in Cell H123 I have applied the following conditional formatting:
    0yrs/0mos/0day and 0yrs/2mos/29day will be Red
    0yrs/2mos/30day and 0yrs/5mos/29day will be Yellow
    0yrs/5mos/30day and 1yrs/6mos/0day will be Green

    But for some reason it is staying red, even though the time remaining shows 0yrs/10mos/4day, not sure where I am going wrong here, anyone have any ideas.
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Conditional Formatting Problem

    Your data is actually text whereby Excel reads 0yrs/10mos/4day as lesser than 0yrs/2mos/4day

    Use numbers and change the CF conditions accordingly
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    03-19-2013
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Conditional Formatting Problem

    I haven't looked at your spreadsheet, yet, but the most common reason why this may be happening is that the box "stop if true" is checked in the conditional formatting rules manager.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,808

    Re: Conditional Formatting Problem

    Your formula generates a string, not a number. And your conditional formatting rules are using "greater than" to compare strings, not numbers. The string "0yrs/10mos/4day" is LESS THAN the string "0yrs/2mos/29day", because strings are compared using alphabetical order.

    Your whole approach can be greatly simplified if you can change your intervals to a number of days (for example, under 90 is red, 90 to under 180 is yellow, 180 and up is green). Then instead of building this string with DATEDIF, you can do a straight subtraction of the dates to get the number of days.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Registered User
    Join Date
    05-17-2014
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Conditional Formatting Problem

    Ace, I have it formatted as date. LG I tried unchecking the stop if true, it did not make a difference.

  6. #6
    Registered User
    Join Date
    05-17-2014
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Conditional Formatting Problem

    6string so basically rewrite my formulas, do you have an example formula I could use as a basis?

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,808

    Re: Conditional Formatting Problem

    Quote Originally Posted by vtgannon View Post
    Ace, I have it formatted as date. LG I tried unchecking the stop if true, it did not make a difference.
    You do not have column H formatted as date, which the source of the problem. (LG's advice was given without looking at your file and does not apply to your case.)

    Here is a revision of your file as an example. For clarity, I had to remove overlapping and conflicting CF rules, but you can use this as an example. Your date strings are now a number of days instead of a string with "xyrs/ymos/zday". CF rules now look at number of days.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-17-2014
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Conditional Formatting Problem

    6String that works very much appreciated.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,808

    Re: Conditional Formatting Problem

    Glad to help. Thanks for the rep, and thanks for marking your thread Solved!

+ 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. Problem with Conditional formatting
    By Ozwilly in forum Excel General
    Replies: 2
    Last Post: 11-13-2011, 10:44 PM
  2. [SOLVED] Conditional formatting problem
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-13-2010, 08:39 PM
  3. Conditional formatting problem
    By Overlord in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2009, 06:01 PM
  4. Conditional Formatting Problem
    By TxAg in forum Excel General
    Replies: 2
    Last Post: 10-03-2005, 05:05 PM
  5. Conditional Formatting Problem
    By andyp161 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-06-2005, 08:46 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