Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2015
    Posts
    51

    Question Answered: Conditional Formatting for negative Percentages

    I can not get the conditional formatting for a negative percentage to work.

    It works fine for normal numbers, negative numbers, even a positive percentage.

    Any ideas?

  2. Best Answer
    Posted by healdem

    "the formatignm shoudl take place after the conditional rule is applied, but if you must deal with text / string repreentations then

    if(left(value,1)) = "-"
    ....format as negative
    if(left(value,1)) <> "-"
    ..format as positive

    but Im pretty certain the 'right' way to do it is to calculate the value, then apply the conditional formatting and the control afterwards applies the format"


  3. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    So what have you tried?
    I'd rather be riding on the Tiger 800 or the Norton

  4. #3
    Join Date
    Jul 2015
    Posts
    51
    I was just typing my reply when I thought of the answer to my problem. When its a negative percentage you have to do a greater than operator.
    see screenshot Sometimes the littlest things can stump you.Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	36.8 KB 
ID:	16597

  5. #4
    Join Date
    Jul 2015
    Posts
    51
    Wait.... nevermind, it was going in the order of rules.... it still doesn't work

  6. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so you want green % to be positive, red to be negative
    there's various ways of achieving that
    value >= 0 set to green
    value < 0 set to red
    I'd rather be riding on the Tiger 800 or the Norton

  7. #6
    Join Date
    Jul 2015
    Posts
    51
    YES, that works for numbers not formatted as a percentage. I want to find out how to make this work for a number formated as a percentage. I can get this to work on positive percentages, like 3.9% but it does not work for a negative percentage like -3.9%

  8. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    the formatignm shoudl take place after the conditional rule is applied, but if you must deal with text / string repreentations then

    if(left(value,1)) = "-"
    ....format as negative
    if(left(value,1)) <> "-"
    ..format as positive

    but Im pretty certain the 'right' way to do it is to calculate the value, then apply the conditional formatting and the control afterwards applies the format
    I'd rather be riding on the Tiger 800 or the Norton

  9. #8
    Join Date
    Jul 2015
    Posts
    51
    OH OK..... I see now, I was formatting in my expression and not the control. it works!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •